reorder Backend methods
This commit is contained in:
@@ -9,14 +9,6 @@ use crate::Package;
|
|||||||
pub struct Pacman;
|
pub struct Pacman;
|
||||||
|
|
||||||
impl Backend for Pacman {
|
impl Backend for Pacman {
|
||||||
fn get_all_installed_packages() -> HashSet<Package> {
|
|
||||||
convert_to_pacdef_packages(get_all_installed_packages_from_alpm())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_explicitly_installed_packages() -> HashSet<Package> {
|
|
||||||
convert_to_pacdef_packages(get_explicitly_installed_packages_from_alpm())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_binary() -> Binary {
|
fn get_binary() -> Binary {
|
||||||
"paru"
|
"paru"
|
||||||
}
|
}
|
||||||
@@ -28,6 +20,14 @@ impl Backend for Pacman {
|
|||||||
fn get_switches_remove() -> Switches {
|
fn get_switches_remove() -> Switches {
|
||||||
&["-Rsn"]
|
&["-Rsn"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_all_installed_packages() -> HashSet<Package> {
|
||||||
|
convert_to_pacdef_packages(get_all_installed_packages_from_alpm())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_explicitly_installed_packages() -> HashSet<Package> {
|
||||||
|
convert_to_pacdef_packages(get_explicitly_installed_packages_from_alpm())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_all_installed_packages_from_alpm() -> HashSet<String> {
|
fn get_all_installed_packages_from_alpm() -> HashSet<String> {
|
||||||
|
|||||||
+10
-10
@@ -6,16 +6,6 @@ use crate::Package;
|
|||||||
pub struct Rust;
|
pub struct Rust;
|
||||||
|
|
||||||
impl Backend for Rust {
|
impl Backend for Rust {
|
||||||
fn get_all_installed_packages() -> HashSet<Package> {
|
|
||||||
extract_packages_names(&run_cargo_install_list())
|
|
||||||
.map(Package::from)
|
|
||||||
.collect()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_explicitly_installed_packages() -> HashSet<Package> {
|
|
||||||
Self::get_all_installed_packages()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_binary() -> Binary {
|
fn get_binary() -> Binary {
|
||||||
"cargo"
|
"cargo"
|
||||||
}
|
}
|
||||||
@@ -27,6 +17,16 @@ impl Backend for Rust {
|
|||||||
fn get_switches_remove() -> Switches {
|
fn get_switches_remove() -> Switches {
|
||||||
&["uninstall"]
|
&["uninstall"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_all_installed_packages() -> HashSet<Package> {
|
||||||
|
extract_packages_names(&run_cargo_install_list())
|
||||||
|
.map(Package::from)
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_explicitly_installed_packages() -> HashSet<Package> {
|
||||||
|
Self::get_all_installed_packages()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_cargo_install_list() -> String {
|
fn run_cargo_install_list() -> String {
|
||||||
|
|||||||
Reference in New Issue
Block a user