diff --git a/src/main.rs b/src/main.rs index ab93cb8..4f98d49 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ use config::Config; use std::io; use std::path::PathBuf; -fn input() -> Result { +fn input() -> io::Result { let mut val = String::new(); io::stdin().read_line(&mut val)?; Ok(val) @@ -52,7 +52,7 @@ fn main() { if input().unwrap().trim().to_lowercase() == "y" { prog.set_default().unwrap_or_else(|err| { println!( - "An error occursed trying to set default {:?}", + "An error occurred trying to set default {:?}", err.kind() ) }); diff --git a/src/packagemanager.rs b/src/packagemanager.rs index 74a4919..90c05d7 100644 --- a/src/packagemanager.rs +++ b/src/packagemanager.rs @@ -88,19 +88,19 @@ impl<'a> PackageManager<'a> { } // Allows setting the default in rux.conf pub fn set_default(&self) -> std::io::Result<()> { - let mut home = match env::home_dir() { + let mut conf = match env::home_dir() { Some(path) => path, None => { println!("Could not find home! Default cannot set properly!"); std::process::exit(1) } }; - home.push(".config/rux/"); - fs::create_dir_all(&home).unwrap_or_else(|why| { + conf.push(".config/rux/"); + fs::create_dir_all(&conf).unwrap_or_else(|why| { println!("! {:?}", why.kind()); }); - home.push("rux.conf"); - let mut file = File::create(home)?; + conf.push("rux.conf"); + let mut file = File::create(conf)?; file.write_all(self.name.as_bytes())?; Ok(()) }