From ccf3e6cfadf3d64169d3b96c0d4e2f0061ceeda8 Mon Sep 17 00:00:00 2001 From: James Price Date: Thu, 1 Oct 2026 14:56:37 +0100 Subject: [PATCH] fix: pass clippy on Rust 1.99 The CI runner's stable toolchain moved from 1.98.1 to 1.99.0 on 2026-10-01, and `cargo clippy --workspace --all-targets -D warnings` now fails on unchanged code: - `clippy::double_must_use` fires on the code `async-trait` 0.1.89 generates for every `#[async_trait]` trait (first hit: `fakecloud-core` `AwsService`). async-trait 0.1.92 stops emitting the redundant `#[must_use]` (dtolnay/async-trait#303); bumped in Cargo.lock. - `AtomicU64::fetch_update` is deprecated in 1.99 in favour of `try_update`, which is newer than the workspace `rust-version` (1.94), so the call keeps `fetch_update` under a scoped `allow(deprecated)` with a note to switch once the MSRV reaches 1.99. - `clippy::needless_borrows_for_generic_args` on closures passed by reference to `is_some_and` / `map` in S3 annotations and SES templates. Workspace clippy is clean on 1.99.0 and 1.98.1; core, s3 and ses build on 1.94. --- Cargo.lock | 17 ++++++++++++++--- crates/fakecloud-s3/src/service/annotations.rs | 2 +- .../fakecloud-s3/src/service/notifications.rs | 4 ++++ crates/fakecloud-ses/src/service/templates.rs | 6 +++--- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e43dda746..fddb77d5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,13 +270,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.89" +version = "0.1.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.6", ] [[package]] @@ -11005,6 +11005,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "sync_wrapper" version = "1.0.2" diff --git a/crates/fakecloud-s3/src/service/annotations.rs b/crates/fakecloud-s3/src/service/annotations.rs index a9e168605..fce583dc4 100644 --- a/crates/fakecloud-s3/src/service/annotations.rs +++ b/crates/fakecloud-s3/src/service/annotations.rs @@ -436,7 +436,7 @@ fn resolve_object_mut<'a>( o.version_id.as_deref() == Some(vid.as_str()) } }; - if b.objects.get(key).is_some_and(&matches) { + if b.objects.get(key).is_some_and(matches) { return b.objects.get_mut(key).ok_or_else(|| no_such_key(key)); } b.object_versions diff --git a/crates/fakecloud-s3/src/service/notifications.rs b/crates/fakecloud-s3/src/service/notifications.rs index 1e0767850..8813145af 100644 --- a/crates/fakecloud-s3/src/service/notifications.rs +++ b/crates/fakecloud-s3/src/service/notifications.rs @@ -398,6 +398,10 @@ static SEQUENCER: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::n pub(crate) fn next_sequencer() -> String { use std::sync::atomic::Ordering; let now = Utc::now().timestamp_micros().max(0) as u64; + // `fetch_update` is deprecated in favour of `try_update` from Rust 1.99, + // which is newer than the workspace's `rust-version`. Switch once the + // MSRV reaches 1.99. + #[allow(deprecated)] let prev = SEQUENCER .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |prev| { Some(now.max(prev.saturating_add(1))) diff --git a/crates/fakecloud-ses/src/service/templates.rs b/crates/fakecloud-ses/src/service/templates.rs index 389189ea5..04827ea19 100644 --- a/crates/fakecloud-ses/src/service/templates.rs +++ b/crates/fakecloud-ses/src/service/templates.rs @@ -274,8 +274,8 @@ pub fn render_template(template: &EmailTemplate, template_data_str: &str) -> Ren result }; RenderedTemplate { - subject: template.subject.as_deref().map(&substitute), - html: template.html_body.as_deref().map(&substitute), - text: template.text_body.as_deref().map(&substitute), + subject: template.subject.as_deref().map(substitute), + html: template.html_body.as_deref().map(substitute), + text: template.text_body.as_deref().map(substitute), } }