pub fn load() -> Config {

        // Set path to .tipsrc first
        let tipsrc = match std::env::var("HOME") {
            Ok(home) => {
                format!("{}/.tipsrc", home)
            },
            Err(err) => {
                panic!("Error loading env HOME: {}", err);
            },
        };

        // read the contents to a string.
        let data = crate::helpers::read_to_string(&tipsrc);

        // deserialize contents into Config struct, and return this
        // struct.
        match serde_yaml::from_str(&data) {
            Ok(file) => file,
            Err(error) => {
                panic!("Error deserialize tipsrc config: {}", error);
            },
        }
    }
// Load config from ~/.tipsrc file and deserialize it into a Config
// struct.
Load config from ~/.tipsrc file and deserialize it into a Config
struct.
Load config from ~ / . tipsrc file and deserialize it into a Config struct .
pub fn load() -> Config {
        // Set path to .tipsrc first
        let tipsrc = match std::env::var("HOME") {
            Ok(home) => {
                format!("{}/.tipsrc", home)
            },
            Err(err) => {
                panic!("Error loading env HOME: {}", err);
            },
        };
        // read the contents to a string.
        let data = crate::helpers::read_to_string(&tipsrc);
        // deserialize contents into Config struct, and return this
        // struct.
        match serde_yaml::from_str(&data) {
            Ok(file) => file,
            Err(error) => {
                panic!("Error deserialize tipsrc config: {}", error);
            },
        }
    }
pub fn load ( ) -> Config { // Set path to .tipsrc first let tipsrc = match std :: env :: var ( " " ) { Ok ( home ) => { format ! ( " " home ) } , Err ( err ) => { panic ! ( " " err ) ; } , } ; // read the contents to a string. let data = crate :: helpers :: read_to_string ( & tipsrc ) ; // deserialize contents into Config struct, and return this // struct. match serde_yaml :: from_str ( & data ) { Ok ( file ) => file , Err ( error ) => { panic ! ( " " error ) ; } , } }
Load config from ~/.tipsrc file and deserialize it into a Config
struct.
Load config from ~ / . tipsrc file and deserialize it into a Config struct .