Fix dead code warnings (#130)

This commit is contained in:
Paolo Barbolini 2021-12-29 08:54:50 +01:00 committed by GitHub
parent 9b7d2786d6
commit 5705c7c785
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 25 deletions

View file

@ -32,8 +32,6 @@ use self::fut::{analyze_dependencies, crawl_manifest};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Engine { pub struct Engine {
client: reqwest::Client,
logger: Logger,
metrics: Arc<StatsdClient>, metrics: Arc<StatsdClient>,
query_crate: Cache<QueryCrate, CrateName>, query_crate: Cache<QueryCrate, CrateName>,
get_popular_crates: Cache<GetPopularCrates, ()>, get_popular_crates: Cache<GetPopularCrates, ()>,
@ -66,15 +64,13 @@ impl Engine {
); );
let retrieve_file_at_path = RetrieveFileAtPath::new(client.clone()); let retrieve_file_at_path = RetrieveFileAtPath::new(client.clone());
let fetch_advisory_db = Cache::new( let fetch_advisory_db = Cache::new(
FetchAdvisoryDatabase::new(client.clone()), FetchAdvisoryDatabase::new(client),
Duration::from_secs(1800), Duration::from_secs(1800),
1, 1,
logger.clone(), logger,
); );
Engine { Engine {
client,
logger,
metrics, metrics,
query_crate, query_crate,
get_popular_crates, get_popular_crates,

View file

@ -15,25 +15,6 @@ use crate::{
const CRATES_API_BASE_URI: &str = "https://crates.io/api/v1"; const CRATES_API_BASE_URI: &str = "https://crates.io/api/v1";
#[derive(Deserialize, Debug)]
struct RegistryPackageDep {
name: String,
req: VersionReq,
#[serde(default)]
kind: Option<String>,
#[serde(default)]
package: Option<String>,
}
#[derive(Deserialize, Debug)]
struct RegistryPackage {
vers: Version,
#[serde(default)]
deps: Vec<RegistryPackageDep>,
#[serde(default)]
yanked: bool,
}
fn convert_pkgs(krate: Crate) -> Result<QueryCrateResponse, Error> { fn convert_pkgs(krate: Crate) -> Result<QueryCrateResponse, Error> {
let name: CrateName = krate.name().parse()?; let name: CrateName = krate.name().parse()?;