diff options
Diffstat (limited to 'src/review/risk.rs')
| -rw-r--r-- | src/review/risk.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/review/risk.rs b/src/review/risk.rs index 73f9be7..cf7069d 100644 --- a/src/review/risk.rs +++ b/src/review/risk.rs @@ -10,7 +10,7 @@ //! what the candidate records now — the same "never last seen" rule that makes //! I2 true for the diff panels. -use crate::db::{self, model::*, Db, Pkgbase}; +use crate::db::{self, model::*, Db}; use crate::error::Result; use crate::pkgver; @@ -48,7 +48,6 @@ impl Assessment { pub fn assess( db: &Db, cfg: &crate::config::Config, - pb: &Pkgbase, new: &Recipe, new_digests: &[SourceDigest], accepted: Option<&ReleaseRow>, @@ -93,12 +92,12 @@ pub fn assess( // Upstream movement that touches the build system (§6): the diff is in a // language ecosystem we cannot inspect, so say so. if let Some(a) = accepted { - for pin in accepted_pins(db, accepted) { + for pin in accepted_pins(accepted) { if let Some(old_pin) = a.pins().into_iter().find(|p| p.index == pin.index) { if !old_pin.commit.is_empty() && !pin.commit.is_empty() && old_pin.commit != pin.commit - && upstream_touches_build_system(cfg, pb, &old_pin.commit, &pin.commit) + && upstream_touches_build_system(cfg, &old_pin.commit, &pin.commit) { s.add("upstream-build-system", level::MEDIUM); } @@ -109,8 +108,7 @@ pub fn assess( Ok(Assessment { level: s.level(), signals: s.signals }) } -fn accepted_pins(db: &Db, accepted: Option<&ReleaseRow>) -> Vec<UpstreamPin> { - let _ = db; +fn accepted_pins(accepted: Option<&ReleaseRow>) -> Vec<UpstreamPin> { accepted.map(|a| a.pins()).unwrap_or_default() } @@ -193,7 +191,7 @@ fn compare_digests( } -fn upstream_touches_build_system(cfg: &crate::config::Config, pb: &Pkgbase, from: &str, to: &str) -> bool { +fn upstream_touches_build_system(cfg: &crate::config::Config, from: &str, to: &str) -> bool { // Best-effort: if we have the upstream clone cached we can ask it directly. let cache = cfg.vcs_cache_dir(); if !cache.exists() { @@ -204,7 +202,6 @@ fn upstream_touches_build_system(cfg: &crate::config::Config, pb: &Pkgbase, from let path = dir.path(); if let Ok(files) = crate::git::git(Some(&path), &["diff", "--name-only", &range]) { if files.lines().any(|f| BUILD_SYSTEM_FILES.iter().any(|b| f.ends_with(b))) { - let _ = pb; return true; } } |
