Skip to content

Commit

Permalink
style: run rustfmt.toml to all rust files
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-TW committed Aug 16, 2024
1 parent 25ccaf8 commit e3e75ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::process::{Stdio};
use std::process::Stdio;

mod env;
mod syntax;
Expand Down
32 changes: 16 additions & 16 deletions src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fn get_sudo(manager: String) -> std::process::Command {
cmd.arg(manager.clone());
cmd
}
_ => std::process::Command::new(manager.clone())
_ => std::process::Command::new(manager.clone()),
};

command
Expand All @@ -18,10 +18,10 @@ pub fn gen_install_syntax(manager: String) -> std::process::Command {
"apt" | "dnf" | "yum" | "pacman" => {
command.arg("install");
command.arg("-y");
},
}
"brew" => {
command.arg("install");
},
}
_ => {
println!("Unknown package manager: {}", manager);
}
Expand All @@ -36,10 +36,10 @@ pub fn gen_uninstall_syntax(manager: String) -> std::process::Command {
"apt" | "dnf" | "yum" | "pacman" => {
command.arg("remove");
command.arg("-y");
},
}
"brew" => {
command.arg("uninstall");
},
}
_ => {
println!("Unknown package manager: {}", manager);
}
Expand All @@ -53,19 +53,19 @@ pub fn gen_update_syntax(manager: String) -> std::process::Command {
match manager.as_str() {
"apt" => {
command.arg("update");
},
}
"dnf" => {
command.arg("check-update");
},
}
"yum" => {
command.arg("check-update");
},
}
"pacman" => {
command.arg("-Sy");
},
}
"brew" => {
command.arg("update");
},
}
_ => {
println!("Unknown package manager: {}", manager);
}
Expand All @@ -79,25 +79,25 @@ pub fn gen_upgrade_syntax(manager: String) -> std::process::Command {
"apt" => {
command.arg("upgrade");
command.arg("-y");
},
}
"dnf" => {
command.arg("upgrade");
command.arg("-y");
},
}
"yum" => {
command.arg("upgrade");
command.arg("-y");
},
}
"pacman" => {
command.arg("-Syu");
},
}
"brew" => {
command.arg("upgrade");
},
}
_ => {
println!("Unknown package manager: {}", manager);
}
}

command
}
}

0 comments on commit e3e75ff

Please sign in to comment.