/// Saves the configuration at a gievn location.
Saves the configuration at a gievn location.
Saves the configuration at a gievn location .
pub fn save<T: AsRef<OsStr>>(&self, config_path: T) {
        match fs::File::create(config_path.as_ref()) {
            // If the file could be created, we write to it.
            Ok(mut file) => match file.write(ron::to_string(self).unwrap().as_bytes()) {
                Ok(_) => println!("Saved new config!"),
                Err(err) => eprintln!("Could not write to the configuration file: {}", err),
            },
            // Otherwise, we print the error.
            Err(err) => {
                eprintln!("Could not create the configuration file: {}", err);
            }
        }
    }
pub fn save < T : AsRef < OsStr > > ( & self , config_path : T ) { match fs :: File :: create ( config_path . as_ref ( ) ) { // If the file could be created, we write to it. Ok ( mut file ) => match file . write ( ron :: to_string ( self ) . unwrap ( ) . as_bytes ( ) ) { Ok ( _ ) => println ! ( " " ) , Err ( err ) => eprintln ! ( " " err ) , } , // Otherwise, we print the error. Err ( err ) => { eprintln ! ( " " err ) ; } } }
Saves the configuration at a gievn location.
Saves the configuration at a gievn location .
&self
config_path
T