chore: update Rust to 1.97.1 - #5849
Conversation
Bump the pinned toolchain and fix the lints the new Clippy reports. The bulk of the diff is the new lint against redundant references in formatting macro arguments: `format!`, `panic!` and `assert_eq!` already take their arguments by reference, so the explicit `&` was pointless. The rest: - `Some(x).filter(|_| cond)` in the SQL schema differ becomes `cond.then_some(x)`. - `a.and_then(|a| b.map(|b| (a, b)))` becomes `a.zip(b)` in the native type parser and the Postgres flavour. - `sort_by(|(a, _), (b, _)| a.cmp(b))` becomes `sort_by_key`. - The Decimal capability check in scalar field validation moves into a match guard. - Two `match`/`if let` blocks that returned `None` on the miss become `?`. - `iter().map(|(_, v)| …)` over maps becomes `values()`. - Drop a no-op `into_iter()` in the MSSQL visitor. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
WalkthroughThe PR updates Rust code across query, schema, connector, validation, and test components. Changes replace explicit formatting borrows, simplify iterator and 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Merging this PR will not alter performance
Comparing Footnotes
|
Wasm Query Compiler File Size
|
These formatting macro calls were already being rewritten to drop redundant references, so capture their arguments in the format string too. Arguments that cannot be captured — method calls and field accesses — stay positional, so a few of these strings mix the two styles. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
2bdf552 to
7b506ab
Compare
Overview
Bumps the pinned toolchain in
rust-toolchain.tomlfrom 1.92.0 to 1.97.1 and fixes everything the new Clippy complains about, somake pedanticis green again.Changes
The bulk of the diff is the new lint against redundant references in formatting macro arguments.
format!,panic!andassert_eq!already take their arguments by reference, so the explicit&was pointless. Purely mechanical, no behaviour change.The rest, one by one:
sql_schema_differ.rs—Some(TableChange::…).filter(|_| differ.primary_key_changed())becomesdiffer.primary_key_changed().then_some(TableChange::…). The lint warns that this reorders the condition against the value; harmless here, since the value is a unit variant and the predicate is a pure query.native_types.rs,flavour/postgres.rs—a.and_then(|a| b.map(|b| (a, b)))becomesa.zip(b).datasource_loader.rs—sort_by(|(a, _), (b, _)| a.cmp(b))becomessort_by_key.validations/fields.rs— theDecimalTypecapability check moves from anifinside the match arm into a match guard.quaint/src/ast/values.rs,query_document/selection.rs— two blocks that returnedNoneon the miss now use?.configuration.rs,statistics.rs,differ_database.rs—iter().map(|(_, v)| …)over maps becomesvalues().visitor/mssql.rs— drop a no-opinto_iter()on an argument that already acceptsIntoIterator.Inlined format arguments
Since the redundant-reference fix was already rewriting those formatting macro calls, the second commit captures their arguments in the format string as well —
panic!("Unknown driver adapter: {}", s)becomespanic!("Unknown driver adapter: {s}").This is scoped to the lines this PR already touches. Every argument that can be captured is, including in calls that also carry arguments that cannot be, so a few strings mix the two styles:
What stays positional is only what the language cannot capture: method calls (
field.name()) and field accesses (self.schema).Note that
clippy::uninlined_format_argsonly fires when all of a call's arguments are capturable, so the mixed cases above are beyond what the lint would ask for. With this PR applied, no fully-capturable call remains on any line it touches.Verification
make pedanticpasses (both the native and thewasm32-unknown-unknownClippy passes).make test-unitpasses: 112 test binaries, no failures.