chore: fix clippy lints for rust 1.97#1721
Conversation
Rust/clippy 1.97 introduced new lints that now fail the CI clippy check (`cargo hack clippy --each-feature -- -D warnings`) against existing code: - for_kv_map: iterate `map.values()` instead of `map.iter()` with an unused key - useless_borrows_in_formatting: drop the redundant `&` in `format!` arguments - cloned_ref_to_slice_refs: use `std::slice::from_ref(x)` instead of `&[x.to_string()]` - collapse a `match` on a `Result` into the `?` operator These are mechanical, behavior-preserving fixes (mostly via `cargo clippy --fix`). No functional change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
WalkthroughThe PR removes unnecessary borrows, unused map keys, and verbose error propagation across Rust modules. Existing iteration behavior, path construction, authorization, error handling, and storage URL generation remain unchanged. ChangesRust cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Rust/clippy 1.97 (now on CI's
stabletoolchain) introduced new lints that fail the clippy check (cargo hack clippy --each-feature --no-dev-deps -- -D warnings) against existing code onmain. This currently breaks thecoveragejob on every open PR, not just one. This PR fixes those lints so CI goes green again.Lints fixed
for_kv_map: iteratemap.values()instead ofmap.iter()when the key is unused (rbac/mod.rs,sse/mod.rs,alerts/target.rs,connectors/kafka/metrics.rs)useless_borrows_in_formatting: drop the redundant&informat!arguments (storage/s3.rs,storage/gcs.rs,metastore/.../object_store_metastore.rs,handlers/airplane.rs,handlers/http/alerts.rs,handlers/http/cluster/mod.rs,metrics/prom_utils.rs,query/listing_table_builder.rs)cloned_ref_to_slice_refs: usestd::slice::from_ref(x)instead of&[x.to_string()](users/filters.rs)matchon aResultinto the?operator (parseable/streams.rs)These are mechanical, behavior-preserving fixes, mostly produced by
cargo clippy --fix. No functional change.Verification
Ran locally with clippy 1.97.0 (matching CI):
cargo clippy --no-deps -- -D warnings: cleancargo clippy --no-default-features --no-deps -- -D warnings: cleanThe
kafkafeature fix (connectors/kafka/metrics.rs) is the samefor_kv_mappattern applied elsewhere; its nativelibrdkafkabuild was not run locally, so CI's--each-featurekafka run will validate it.Summary by CodeRabbit