move add_packages to macro

This commit is contained in:
steven-omaha
2023-01-10 12:05:36 +01:00
parent 26c1e317bd
commit 02116b1f16
3 changed files with 6 additions and 12 deletions
+6
View File
@@ -33,5 +33,11 @@ macro_rules! impl_backend_constants {
self.packages.insert(package.clone()); self.packages.insert(package.clone());
}) })
} }
fn add_packages(&mut self, packages: HashSet<Package>) {
for p in packages {
self.packages.insert(p);
}
}
}; };
} }
-6
View File
@@ -25,12 +25,6 @@ impl Backend for Pacman {
fn get_explicitly_installed_packages(&self) -> HashSet<Package> { fn get_explicitly_installed_packages(&self) -> HashSet<Package> {
convert_to_pacdef_packages(get_explicitly_installed_packages_from_alpm()) convert_to_pacdef_packages(get_explicitly_installed_packages_from_alpm())
} }
fn add_packages(&mut self, packages: HashSet<Package>) {
for p in packages {
self.packages.insert(p);
}
}
} }
fn get_all_installed_packages_from_alpm() -> HashSet<String> { fn get_all_installed_packages_from_alpm() -> HashSet<String> {
-6
View File
@@ -24,12 +24,6 @@ impl Backend for Rust {
fn get_explicitly_installed_packages(&self) -> HashSet<Package> { fn get_explicitly_installed_packages(&self) -> HashSet<Package> {
self.get_all_installed_packages() self.get_all_installed_packages()
} }
fn add_packages(&mut self, packages: HashSet<Package>) {
for p in packages {
self.packages.insert(p);
}
}
} }
fn run_cargo_install_list() -> String { fn run_cargo_install_list() -> String {