major overhaul of Backend from dynamic to static dispatch using an big enum
This commit is contained in:
@@ -10,7 +10,19 @@ use crate::{Group, Package};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Fedora {
|
||||
pub(crate) packages: HashSet<Package>,
|
||||
pub packages: HashSet<Package>,
|
||||
}
|
||||
impl Fedora {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
packages: HashSet::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Default for Fedora {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
const BINARY: Text = "dnf";
|
||||
@@ -123,14 +135,6 @@ impl Backend for Fedora {
|
||||
}
|
||||
}
|
||||
|
||||
impl Fedora {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
packages: HashSet::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn create_package(package: &str) -> Package {
|
||||
if DEFAULT_REPOS.iter().any(|repo| package.contains(repo)) && !package.contains("copr") {
|
||||
let package = package.split('/').nth(1).expect("Cannot be empty!");
|
||||
|
||||
Reference in New Issue
Block a user