major overhaul of Backend from dynamic to static dispatch using an big enum
This commit is contained in:
@@ -12,7 +12,19 @@ use crate::{Group, Package};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Rust {
|
||||
pub(crate) packages: HashSet<Package>,
|
||||
pub packages: HashSet<Package>,
|
||||
}
|
||||
impl Rust {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
packages: HashSet::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Default for Rust {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
const BINARY: Text = "cargo";
|
||||
@@ -76,14 +88,6 @@ fn extract_packages(json: &Value) -> Result<HashSet<Package>> {
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
impl Rust {
|
||||
pub(crate) fn new() -> Self {
|
||||
Self {
|
||||
packages: HashSet::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_crates_file() -> Result<PathBuf> {
|
||||
let mut result = crate::path::get_cargo_home().context("getting cargo home dir")?;
|
||||
result.push(".crates2.json");
|
||||
|
||||
Reference in New Issue
Block a user