Skip to content

chore: update Rust to 1.97.1 - #5849

Merged
aqrln merged 2 commits into
mainfrom
chore/rust-1.97
Jul 27, 2026
Merged

chore: update Rust to 1.97.1#5849
aqrln merged 2 commits into
mainfrom
chore/rust-1.97

Conversation

@tensordreams

@tensordreams tensordreams commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Overview

Bumps the pinned toolchain in rust-toolchain.toml from 1.92.0 to 1.97.1 and fixes everything the new Clippy complains about, so make pedantic is green again.

Changes

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. Purely mechanical, no behaviour change.

The rest, one by one:

  • sql_schema_differ.rsSome(TableChange::…).filter(|_| differ.primary_key_changed()) becomes differ.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.rsa.and_then(|a| b.map(|b| (a, b))) becomes a.zip(b).
  • datasource_loader.rssort_by(|(a, _), (b, _)| a.cmp(b)) becomes sort_by_key.
  • validations/fields.rs — the DecimalType capability check moves from an if inside the match arm into a match guard.
  • quaint/src/ast/values.rs, query_document/selection.rs — two blocks that returned None on the miss now use ?.
  • configuration.rs, statistics.rs, differ_database.rsiter().map(|(_, v)| …) over maps becomes values().
  • visitor/mssql.rs — drop a no-op into_iter() on an argument that already accepts IntoIterator.

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) becomes panic!("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:

format!("{alter_column_prefix} SET DATA TYPE {}", render_column_type(columns.next, renderer))

What stays positional is only what the language cannot capture: method calls (field.name()) and field accesses (self.schema).

Note that clippy::uninlined_format_args only 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 pedantic passes (both the native and the wasm32-unknown-unknown Clippy passes).
  • make test-unit passes: 112 test binaries, no failures.

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>
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The PR updates Rust code across query, schema, connector, validation, and test components. Changes replace explicit formatting borrows, simplify iterator and Option handling with zip, values, sort_by_key, and then_some, use a guarded match for decimal capability validation, simplify row flattening and filter accumulation, and update generated SQL or error-message formatting. The Rust toolchain channel changes from 1.92.0 to 1.97.1.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.62% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title correctly summarizes the main change: bumping the Rust toolchain to 1.97.1.
Description check ✅ Passed The description is clearly related to the diff, covering the toolchain bump and the Clippy-driven cleanup changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/rust-1.97
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/rust-1.97

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 11 untouched benchmarks
⏩ 11 skipped benchmarks1


Comparing chore/rust-1.97 (7b506ab) with main (9d90ce2)

Open in CodSpeed

Footnotes

  1. 11 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Wasm Query Compiler File Size

Engine This PR Base branch Diff
Postgres 3.279MiB 3.509MiB -236.016KiB
Postgres (gzip) 1.089MiB 1.143MiB -55.894KiB
Postgres (size-optimized) 1.655MiB 1.768MiB -116.021KiB
Postgres (size-optimized, gzip) 661.978KiB 695.966KiB -33.989KiB
Mysql 3.235MiB 3.462MiB -231.869KiB
Mysql (gzip) 1.071MiB 1.128MiB -58.667KiB
Mysql (size-optimized) 1.625MiB 1.738MiB -115.920KiB
Mysql (size-optimized, gzip) 652.276KiB 684.445KiB -32.169KiB
Sqlite 3.152MiB 3.380MiB -233.057KiB
Sqlite (gzip) 1.041MiB 1.099MiB -59.878KiB
Sqlite (size-optimized) 1.585MiB 1.694MiB -111.705KiB
Sqlite (size-optimized, gzip) 635.223KiB 667.611KiB -32.388KiB
SQL Server 3.362MiB 3.597MiB -240.191KiB
SQL Server (gzip) 1.097MiB 1.161MiB -65.372KiB
SQL Server (size-optimized) 1.652MiB 1.767MiB -117.578KiB
SQL Server (size-optimized, gzip) 664.799KiB 698.851KiB -34.052KiB
CockroachDB 3.324MiB 3.559MiB -241.258KiB
CockroachDB (gzip) 1.106MiB 1.162MiB -57.907KiB
CockroachDB (size-optimized) 1.676MiB 1.793MiB -119.644KiB
CockroachDB (size-optimized, gzip) 672.061KiB 705.976KiB -33.916KiB

@aqrln aqrln added this to the 7.10.0 milestone Jul 27, 2026
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>
@aqrln
aqrln merged commit 0edf323 into main Jul 27, 2026
103 of 105 checks passed
@aqrln
aqrln deleted the chore/rust-1.97 branch July 27, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants