Ran a linter to improve code
This commit is contained in:
parent
b06fc99e9e
commit
27b87f7da2
@ -26,7 +26,7 @@ impl Config {
|
||||
let mut prog = match get {
|
||||
None => {
|
||||
println!("Sorry, your package manager does not support this action");
|
||||
std::process::exit(0);
|
||||
std::process::exit(0)
|
||||
},
|
||||
Some(vec) => vec,
|
||||
};
|
||||
@ -41,7 +41,7 @@ impl Config {
|
||||
child.wait().expect("Failed to wait on package manager");
|
||||
},
|
||||
(_, &None) => {
|
||||
for arg in prog.iter() {
|
||||
for arg in &prog {
|
||||
let mut child =Command::new(&command)
|
||||
.arg(arg)
|
||||
.spawn()
|
||||
@ -50,7 +50,7 @@ impl Config {
|
||||
}
|
||||
},
|
||||
(Some(_), &Some(ref term)) => {
|
||||
for arg in prog.iter() {
|
||||
for arg in &prog {
|
||||
let mut child = Command::new(&command)
|
||||
.arg(arg)
|
||||
.arg(term)
|
||||
|
@ -24,7 +24,7 @@ impl Management {
|
||||
let man = match man {
|
||||
None => {
|
||||
help();
|
||||
std::process::exit(0);
|
||||
std::process::exit(0)
|
||||
}
|
||||
Some(val) => val,
|
||||
};
|
||||
|
@ -91,7 +91,7 @@ impl<'a> PackageManager<'a> {
|
||||
// the current folder.
|
||||
pub fn set_default(&self) -> std::io::Result<()> {
|
||||
let mut file = File::create("default.conf")?;
|
||||
file.write_all(format!("{}", self.name).as_bytes())?;
|
||||
file.write_all(self.name.as_bytes())?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@ -100,6 +100,7 @@ impl<'a> PackageManager<'a> {
|
||||
/// Pulls the first line out of the default.conf and loads that.
|
||||
/// If it doesn't recognize the file it will tell the user that there's an
|
||||
/// issue before exiting.
|
||||
// TODO: Have this delete malformed default.conf
|
||||
pub fn read_default<'a>() -> PackageManager<'a> {
|
||||
let file = File::open("default.conf").unwrap();
|
||||
let buffered = BufReader::new(file);
|
||||
|
Loading…
x
Reference in New Issue
Block a user