add more generic backend stuff

This commit is contained in:
Dr. Matthias Ratajczak
2023-01-05 17:57:38 +01:00
parent 4c22f1cc89
commit 265d67089b
3 changed files with 59 additions and 19 deletions
+12 -4
View File
@@ -6,10 +6,6 @@ use crate::Package;
pub struct Rust;
impl Backend for Rust {
const BINARY: Binary = "cargo";
const SWITCHES_INSTALL: Switches = &["install"];
const SWITCHES_REMOVE: Switches = &["uninstall"];
fn get_all_installed_packages() -> HashSet<Package> {
extract_packages_names(&run_cargo_install_list())
.map(Package::from)
@@ -19,6 +15,18 @@ impl Backend for Rust {
fn get_explicitly_installed_packages() -> HashSet<Package> {
Self::get_all_installed_packages()
}
fn get_binary() -> Binary {
"cargo"
}
fn get_switches_install() -> Switches {
&["install"]
}
fn get_switches_remove() -> Switches {
&["uninstall"]
}
}
fn run_cargo_install_list() -> String {