From 41ea7136c10fc6bcb513506682dcbcaa5a2d4711 Mon Sep 17 00:00:00 2001 From: Shiv Rossi Date: Tue, 6 Oct 2026 19:29:33 -0600 Subject: [PATCH] =?UTF-8?q?fix(ci):=20resolve=20clippy=201.99.0=20warnings?= =?UTF-8?q?=20=E2=80=94=20must=5Fuse=20futures=20+=20assert=5Fis=5Fempty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/iris-cli/src/watch.rs | 29 +++++++++---------- crates/iris-core/src/audit.rs | 3 ++ crates/iris-core/src/ingest.rs | 3 ++ crates/iris-core/src/provider.rs | 3 ++ crates/iris-core/src/storage.rs | 3 ++ crates/iris-core/src/wire.rs | 15 ++++++++-- crates/iris-providers/src/email.rs | 6 ++-- crates/iris-providers/src/herdr/mod.rs | 2 +- crates/iris-providers/src/mock.rs | 2 +- .../iris-providers/src/telegram/realtime.rs | 5 +++- crates/iris-server/src/routes.rs | 2 +- 11 files changed, 48 insertions(+), 25 deletions(-) diff --git a/crates/iris-cli/src/watch.rs b/crates/iris-cli/src/watch.rs index 720edb9..57db76f 100644 --- a/crates/iris-cli/src/watch.rs +++ b/crates/iris-cli/src/watch.rs @@ -462,8 +462,8 @@ mod tests { .expect("accented code point") + 1; let mut parser = SseParser::new(); - assert!(parser.feed(&bytes[..=first_cr]).is_empty()); - assert!(parser.feed(&rest[..utf8_split]).is_empty()); + assert_eq!(parser.feed(&bytes[..=first_cr]), Vec::::new()); + assert_eq!(parser.feed(&rest[..utf8_split]), Vec::::new()); assert_eq!( parser.feed(&rest[utf8_split..]), vec![SseFrame::Message { @@ -477,8 +477,8 @@ mod tests { #[test] fn parser_handles_split_chunks() { let mut parser = SseParser::new(); - assert!(parser.feed(b"event: mes").is_empty()); - assert!(parser.feed(b"sage\ndata: {\"a\":").is_empty()); + assert_eq!(parser.feed(b"event: mes"), Vec::::new()); + assert_eq!(parser.feed(b"sage\ndata: {\"a\":"), Vec::::new()); assert_eq!( parser.feed(b"1}\n\n"), vec![SseFrame::Message { @@ -525,10 +525,9 @@ mod tests { #[test] fn parser_finish_flushes_partial_frame() { let mut parser = SseParser::new(); - assert!( - parser - .feed(b"event: error\ndata: {\"code\":\"provider_failed\"}") - .is_empty() + assert_eq!( + parser.feed(b"event: error\ndata: {\"code\":\"provider_failed\"}"), + Vec::::new() ); assert_eq!( parser.finish(), @@ -543,7 +542,7 @@ mod tests { #[test] fn parser_handles_cr_newlines() { let mut parser = SseParser::new(); - assert!(parser.feed(b"event: message\r").is_empty()); + assert_eq!(parser.feed(b"event: message\r"), Vec::::new()); assert_eq!( parser.feed(b"data: {\"ok\":1}\n\n"), vec![SseFrame::Message { @@ -572,8 +571,8 @@ mod tests { #[test] fn parser_split_crlf_does_not_clear_frame_id_or_duplicate_frame() { let mut parser = SseParser::new(); - assert!(parser.feed(b"id: cursor-1\r").is_empty()); - assert!(parser.feed(&[]).is_empty()); + assert_eq!(parser.feed(b"id: cursor-1\r"), Vec::::new()); + assert_eq!(parser.feed(&[]), Vec::::new()); assert_eq!( parser.feed(b"\ndata: {\"ok\":1}\r\n\r\n"), vec![SseFrame::Message { @@ -581,7 +580,7 @@ mod tests { data: "{\"ok\":1}".into(), }] ); - assert!(parser.finish().is_empty()); + assert_eq!(parser.finish(), Vec::::new()); } /// The server URL comes from the environment with a sane default. @@ -694,7 +693,7 @@ mod tests { .await .unwrap(); assert!(should_exit); - assert!(out.is_empty()); + assert_eq!(out, Vec::::new()); assert!( String::from_utf8(err) .unwrap() @@ -771,7 +770,7 @@ mod tests { .await .unwrap(); assert!(should_exit); - assert!(out.is_empty()); + assert_eq!(out, Vec::::new()); let diagnostic = String::from_utf8(err).unwrap(); assert!(diagnostic.contains(expected_diagnostic), "{diagnostic}"); assert!( @@ -803,7 +802,7 @@ mod tests { .await .unwrap(); assert!(!should_exit); - assert!(err.is_empty()); + assert_eq!(err, Vec::::new()); let value: serde_json::Value = serde_json::from_slice(&out).unwrap(); assert_eq!(value["cursor"], "cursor-1"); assert_eq!( diff --git a/crates/iris-core/src/audit.rs b/crates/iris-core/src/audit.rs index d9f3feb..166df86 100644 --- a/crates/iris-core/src/audit.rs +++ b/crates/iris-core/src/audit.rs @@ -93,6 +93,9 @@ pub enum RecordOutcome { } /// Append-only, provider-agnostic audit storage. +// Trait methods return `Result`, which is already `#[must_use]`; suppress the +// redundant-attribute lint that rust 1.99's clippy raises on async traits. +#[allow(clippy::double_must_use)] #[async_trait] pub trait AuditLog: std::fmt::Debug + Send + Sync { /// Append an event and return its hash-linked entry. diff --git a/crates/iris-core/src/ingest.rs b/crates/iris-core/src/ingest.rs index 2a10457..d8f99b0 100644 --- a/crates/iris-core/src/ingest.rs +++ b/crates/iris-core/src/ingest.rs @@ -94,6 +94,9 @@ pub enum IngestOutcome { } /// Durable all-or-nothing normalized-object ingestion. +// Trait methods return `Result`, which is already `#[must_use]`; suppress the +// redundant-attribute lint that rust 1.99's clippy raises on async traits. +#[allow(clippy::double_must_use)] #[async_trait] pub trait IngestStore: std::fmt::Debug + Send + Sync { /// Apply the batch, replay record, cursor, and audit event atomically. diff --git a/crates/iris-core/src/provider.rs b/crates/iris-core/src/provider.rs index 5ef0557..5141127 100644 --- a/crates/iris-core/src/provider.rs +++ b/crates/iris-core/src/provider.rs @@ -51,6 +51,9 @@ impl ProviderMetadata { /// Providers normalize their source-specific data into Iris's unified model. /// The trait is async because all providers involve some form of I/O /// (API calls, database queries, webhook processing). +// Trait methods return `Result`, which is already `#[must_use]`; suppress the +// redundant-attribute lint that rust 1.99's clippy raises on async traits. +#[allow(clippy::double_must_use)] #[async_trait] pub trait MessageProvider: Send + Sync { /// Static metadata about this provider. diff --git a/crates/iris-core/src/storage.rs b/crates/iris-core/src/storage.rs index 8d66cdd..fd7e17c 100644 --- a/crates/iris-core/src/storage.rs +++ b/crates/iris-core/src/storage.rs @@ -40,6 +40,9 @@ pub struct AttachmentRef { /// Implementations are responsible for persisting attachment bytes and /// returning stable, resolvable references. The trait is async because /// all storage backends involve I/O. +// Trait methods return `Result`, which is already `#[must_use]`; suppress the +// redundant-attribute lint that rust 1.99's clippy raises on async traits. +#[allow(clippy::double_must_use)] #[async_trait] pub trait AttachmentStore: std::fmt::Debug + Send + Sync { /// Store attachment content, returning a reference with assigned ID and URL. diff --git a/crates/iris-core/src/wire.rs b/crates/iris-core/src/wire.rs index a822216..d2a49ab 100644 --- a/crates/iris-core/src/wire.rs +++ b/crates/iris-core/src/wire.rs @@ -265,9 +265,18 @@ mod tests { #[test] fn absent_and_null_attachments_decode_to_empty() { - assert!(decode_attachments(None).unwrap().is_empty()); - assert!(decode(&json!(null)).unwrap().is_empty()); - assert!(decode(&json!([])).unwrap().is_empty()); + assert_eq!( + decode_attachments(None).unwrap(), + Vec::::new() + ); + assert_eq!( + decode(&json!(null)).unwrap(), + Vec::::new() + ); + assert_eq!( + decode(&json!([])).unwrap(), + Vec::::new() + ); } #[test] diff --git a/crates/iris-providers/src/email.rs b/crates/iris-providers/src/email.rs index 09f411f..313628f 100644 --- a/crates/iris-providers/src/email.rs +++ b/crates/iris-providers/src/email.rs @@ -1274,7 +1274,7 @@ mod tests { let store = test_store(); // Before storage, the URL is a provider pseudo-URL. - assert!(!email.attachments.is_empty()); + assert_ne!(email.attachments, [] as [iris_core::Attachment; 0]); assert!(email.attachments[0].url.starts_with("email:message:")); email @@ -1312,7 +1312,7 @@ mod tests { .store_attachments(&store) .await .expect("no-op succeeds"); - assert!(email.attachments.is_empty()); + assert_eq!(email.attachments, [] as [iris_core::Attachment; 0]); } #[test] @@ -1510,7 +1510,7 @@ mod tests { ..Default::default() }; let selected = select_uids(Vec::new(), &opts, 500); - assert!(selected.is_empty()); + assert_eq!(selected, [] as [u32; 0]); } #[test] diff --git a/crates/iris-providers/src/herdr/mod.rs b/crates/iris-providers/src/herdr/mod.rs index 76c487e..97c66fb 100644 --- a/crates/iris-providers/src/herdr/mod.rs +++ b/crates/iris-providers/src/herdr/mod.rs @@ -525,7 +525,7 @@ mod tests { }) .unwrap(); - assert!(batch.mutations.is_empty()); + assert_eq!(batch.mutations, [] as [iris_core::IngestMutation; 0]); let audit = batch .audit .as_ref() diff --git a/crates/iris-providers/src/mock.rs b/crates/iris-providers/src/mock.rs index ee2a8c6..f0767a6 100644 --- a/crates/iris-providers/src/mock.rs +++ b/crates/iris-providers/src/mock.rs @@ -437,7 +437,7 @@ mod tests { .send_message("thread-7", &OutboundMessage::text("plain")) .await .expect("text send succeeds"); - assert!(message.attachments.is_empty()); + assert_eq!(message.attachments, [] as [iris_core::Attachment; 0]); assert_eq!( provider.recorded_sends().expect("records readable").len(), 2 diff --git a/crates/iris-providers/src/telegram/realtime.rs b/crates/iris-providers/src/telegram/realtime.rs index 1b5804d..5f1254a 100644 --- a/crates/iris-providers/src/telegram/realtime.rs +++ b/crates/iris-providers/src/telegram/realtime.rs @@ -1292,7 +1292,10 @@ mod tests { TelegramProvider::with_base_url("123:abc", server.uri(), Arc::new(InMemoryStore)) .expect("provider builds"); let hub = provider.realtime_hub().expect("valid realtime settings"); - assert!(hub.snapshot_messages(provider.clone()).is_empty()); + assert_eq!( + hub.snapshot_messages(provider.clone()), + [] as [iris_core::Message; 0] + ); for _ in 0..200 { if hub.cursor() == 101 { diff --git a/crates/iris-server/src/routes.rs b/crates/iris-server/src/routes.rs index 19fbd96..5bb7eb0 100644 --- a/crates/iris-server/src/routes.rs +++ b/crates/iris-server/src/routes.rs @@ -69,7 +69,7 @@ pub struct ProviderResponse { } pub fn router(state: AppState) -> Router { - debug_assert!(!generated::GENERATED_ROUTES.is_empty()); + debug_assert_ne!(generated::GENERATED_ROUTES, []); let generated = generated::generated_router() .layer(middleware::from_fn_with_state(state.clone(), ingest_auth)); let router = Router::new()