From e80ac6735e8a5f4699057777c9838937cac72aa3 Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Mon, 20 Jul 2026 21:25:04 +0000 Subject: [PATCH] chore: satisfy nightly clippy (question_mark, fetch_update) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two lints surface under a newer/nightly clippy that today's stable doesn't yet flag: - aube-lockfile/src/source.rs: rewrite the trailing `exec:` arm with the `?` operator (clippy::question_mark). Behavior is identical — the function already returns `Option`. - aube/src/progress/mod.rs: `Atomic::fetch_update` is deprecated in Rust 1.99 in favor of `try_update`, but `try_update` is only stable since 1.95 and our MSRV is 1.93, so switching would break `cargo-msrv`. Add a scoped `#[allow(deprecated)]` with a note to swap it once the MSRV clears 1.95. Verified clean under both `cargo clippy` (stable) and `cargo +nightly clippy` with `-D warnings`. Co-Authored-By: Claude Opus 4.8 --- crates/aube-lockfile/src/source.rs | 5 ++--- crates/aube/src/progress/mod.rs | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/aube-lockfile/src/source.rs b/crates/aube-lockfile/src/source.rs index 191b93588..9acf398da 100644 --- a/crates/aube-lockfile/src/source.rs +++ b/crates/aube-lockfile/src/source.rs @@ -259,10 +259,9 @@ impl LocalSource { ("link", r) } else if let Some(r) = spec.strip_prefix("portal:") { ("portal", r) - } else if let Some(r) = spec.strip_prefix("exec:") { - return Some(LocalSource::Exec(PathBuf::from(r))); } else { - return None; + let r = spec.strip_prefix("exec:")?; + return Some(LocalSource::Exec(PathBuf::from(r))); }; let rel = PathBuf::from(rest); let abs = project_root.join(&rel); diff --git a/crates/aube/src/progress/mod.rs b/crates/aube/src/progress/mod.rs index 3f08f743d..6a2a1847f 100644 --- a/crates/aube/src/progress/mod.rs +++ b/crates/aube/src/progress/mod.rs @@ -72,6 +72,11 @@ fn overflow_fetch_label(count: usize) -> String { fn clamp_reused_to(reused: &AtomicUsize, downloaded: &AtomicUsize, total: usize) { let dl = downloaded.load(Ordering::Relaxed); let cap = total.saturating_sub(dl); + // `fetch_update` is renamed to `try_update` in Rust 1.99, but that method + // is only stable since 1.95 and our MSRV is 1.93 — switch once the MSRV + // clears 1.95. The deprecation is nightly-only for now; allow it so a + // nightly `clippy -D warnings` stays green. + #[allow(deprecated)] let _ = reused.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |cur| { (cur > cap).then_some(cap) });