From 3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 Mon Sep 17 00:00:00 2001 From: aur-build Date: Sun, 22 Nov 2026 10:36:24 +0000 Subject: rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off rustfmt.toml fixes the shape the tree is written in (120 columns, small items kept on one line) and one canonical pass makes it the truth. [lints.clippy] names the idiom lints worth enforcing and leaves out the two that would add doc-comment boilerplate rather than remove it. The tree pays them off here: write!/writeln! instead of push_str(&format!()), let-else instead of match-on-Option, borrows where a thread entry point only reads what it owns, no `&self` on a Copy state and no `self` nobody reads. ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and value are now emitted by the same call instead of three. --- src/review/intake.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/review/intake.rs') diff --git a/src/review/intake.rs b/src/review/intake.rs index 7d84544..78e4eb6 100644 --- a/src/review/intake.rs +++ b/src/review/intake.rs @@ -11,7 +11,11 @@ //! and review decides what a candidate means. use crate::config::Config; -use crate::db::{self, model::*, Db, Pkgbase}; +use crate::db::{ + self, + model::{Recipe, ReleaseRow, SourceDigest}, + Db, Pkgbase, +}; use crate::error::Result; use crate::review::candidates::{self, NewCandidate, Upsert}; use crate::review::risk; @@ -47,19 +51,14 @@ pub fn record( /// published yet — the reason a build would fail on a missing dep, said before /// it runs. fn missing_deps(db: &Db, pb: &Pkgbase, recipe: &Recipe) -> Vec { - let ours = match db::our_package_names(db) { - Ok(o) => o, - Err(_) => return Vec::new(), - }; + let Ok(ours) = db::our_package_names(db) else { return Vec::new() }; let mut out = Vec::new(); for dep in crate::pkgver::dep_names(&recipe.depends) { if ours.contains(&dep) || dep == pb.name || recipe.pkgnames.contains(&dep) { continue; } - let ours_to_publish = db::get_subscription(db, &dep) - .map(|s| s.is_some()) - .unwrap_or(false) - || db::get_pkgbase(db, &dep).map(|p| p.is_some()).unwrap_or(false); + let ours_to_publish = db::get_subscription(db, &dep).is_ok_and(|s| s.is_some()) + || db::get_pkgbase(db, &dep).is_ok_and(|p| p.is_some()); if ours_to_publish { out.push(dep); } -- cgit v1.2.3