Move over api\ examples\ src\ dirs

Search and replace models::models::models:: with models::
(Fix this instance back up!)

In src/client/mod.rs:

~ line 734 change to:

                            GetApiResponse::OK(models::Yaml::from(body).to_string())

~ line 752:

                            GetApiResponse::FileNotFound(models::ApiError::from(body).to_string())

In src/server/mod.rs

~ line 91

        pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&vec![

~ line 879, 892

                                                    response.set_body(String::from(body));

in models.rs (instead of Err())

~line 370, 649, 732

            e => Err(format!("Invalid value {}", e)),

~line 365, 642, 727

    type Err = String;

And add:

// Added manually

use std::str::FromStr;
use std::num::ParseIntError;
use std::num::ParseBoolError;

impl FromStr for Addr {
    type Err = ParseIntError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.parse::<i32>() {
            Ok(val) => Ok(Addr(val)),
            Err(e) => Err(e)
        }
    }
}

impl FromStr for AddrEnabled {
    type Err = ParseBoolError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.parse::<bool>() {
            Ok(val) => Ok(AddrEnabled(val)),
            Err(e) => Err(e)
        }
    }
}

impl FromStr for AddrIndex {
    type Err = ParseIntError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.parse::<i32>() {
            Ok(val) => Ok(AddrIndex(val)),
            Err(e) => Err(e)
        }
    }
}

impl FromStr for Current {
    type Err = ParseIntError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.parse::<i32>() {
            Ok(val) => Ok(Current(val)),
            Err(e) => Err(e)
        }
    }
}

impl FromStr for Freq {
    type Err = ParseIntError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.parse::<i32>() {
            Ok(val) => Ok(Freq(val)),
            Err(e) => Err(e)
        }
    }
}

impl FromStr for LedIndex {
    type Err = ParseIntError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.parse::<i32>() {
            Ok(val) => Ok(LedIndex(val)),
            Err(e) => Err(e)
        }
    }
}

impl FromStr for Offset {
    type Err = ParseIntError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.parse::<i32>() {
            Ok(val) => Ok(Offset(val)),
            Err(e) => Err(e)
        }
    }
}

impl FromStr for Pwm {
    type Err = ParseIntError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.parse::<i32>() {
            Ok(val) => Ok(Pwm(val)),
            Err(e) => Err(e)
        }
    }
}

impl FromStr for Sleep {
    type Err = ParseIntError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.parse::<i32>() {
            Ok(val) => Ok(Sleep(val)),
            Err(e) => Err(e)
        }
    }
}
