Commit 0edf323
authored
chore: update Rust to 1.97.1 (#5849)
## 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.rs`** — `Some(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.rs`** — `a.and_then(|a|
b.map(|b| (a, b)))` becomes `a.zip(b)`.
- **`datasource_loader.rs`** — `sort_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.rs`** —
`iter().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:
```rust
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.
---------
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>1 parent 9d90ce2 commit 0edf323
43 files changed
Lines changed: 101 additions & 143 deletions
File tree
- libs
- driver-adapters/src/conversion
- user-facing-errors/src
- query_engine
- psl
- parser-database/src
- psl-core/src
- datamodel_connector
- validate
- validation_pipeline/validations
- relations
- many_to_many
- psl/tests/common
- quaint/src
- ast
- tests
- query
- test_api
- types
- visitor
- query-compiler
- core/src
- query_document
- query_graph_builder/extractors/filters
- query-builders/sql-query-builder/src
- query-structure/src
- request-handlers/src/protocols/json
- query-engine
- connector-test-kit-rs/qe-setup/src
- connectors/mongodb-query-connector/src/root_queries/update
- schema-engine
- cli/tests
- connectors
- mongodb-schema-connector/src/sampler
- sql-schema-connector/src
- flavour
- mssql
- postgres
- sqlite
- sql_schema_differ
- datamodel-renderer/src
- sql-introspection-tests/src
- sql-migration-tests/src
- sql-schema-describer/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
| 206 | + | |
208 | 207 | | |
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 212 | + | |
217 | 213 | | |
218 | 214 | | |
219 | 215 | | |
| |||
469 | 465 | | |
470 | 466 | | |
471 | 467 | | |
472 | | - | |
| 468 | + | |
473 | 469 | | |
474 | 470 | | |
475 | 471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
Lines changed: 15 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
308 | 304 | | |
309 | | - | |
310 | | - | |
311 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
368 | | - | |
| 367 | + | |
369 | 368 | | |
370 | 369 | | |
371 | | - | |
| 370 | + | |
372 | 371 | | |
373 | 372 | | |
374 | 373 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments