From 041640692d13bfa187691da0b5b1536d07c65e28 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Tue, 26 Apr 2022 23:46:44 +0200 Subject: [PATCH] Use `crate_scope` in advisory query (#153) --- src/engine/machines/analyzer.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/engine/machines/analyzer.rs b/src/engine/machines/analyzer.rs index 99349f4..a2e9aae 100644 --- a/src/engine/machines/analyzer.rs +++ b/src/engine/machines/analyzer.rs @@ -40,15 +40,11 @@ impl DependencyAnalyzer { let name: cargo_lock::Name = name.as_ref().parse().unwrap(); let version: cargo_lock::Version = ver.to_string().parse().unwrap(); - let query = database::Query::new().package_version(name, version); + let query = database::Query::crate_scope().package_version(name, version); if let Some(db) = advisory_db { - let vulnerabilities: Vec<_> = db - .query(&query) - .into_iter() - .filter(|vuln| !vuln.withdrawn()) - .map(|v| v.to_owned()) - .collect(); + let vulnerabilities: Vec<_> = + db.query(&query).into_iter().map(|v| v.to_owned()).collect(); if !vulnerabilities.is_empty() { dep.vulnerabilities = vulnerabilities; }