mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
f93a867d77
The `wasm` and `next-custom-transforms` crates were still on Rust edition 2018 while the rest of the crates in this repo use edition 2024. This caused a pre-commit hook conflict:
- `cargo fmt` passes the crate's own edition (2018) to `rustfmt`, which uses **case-insensitive** import sorting
- The lint-staged pre-commit hook runs `rustfmt --edition 2024 --`, which uses **ASCII order** import sorting (uppercase before lowercase)
These two sort orders disagree on items like `{custom_before_pass, TransformOptions}` vs `{TransformOptions, custom_before_pass}`, causing an infinite flip-flop: every commit would reorder imports, and the next `cargo fmt` would reorder them back.
## Changes
- Bump `crates/wasm` and `crates/next-custom-transforms` from edition 2018 to 2024
- Add `+ use<C>` precise capturing to `server_actions()` return type to satisfy edition 2024's stricter `impl Trait` lifetime capture rules
- Add `style_edition = "2024"` to `.rustfmt.toml` as a safety net so `cargo fmt` uses 2024-style formatting regardless of individual crate editions
- Reformat all affected files with `cargo fmt`
- Apply new clippy rules
16 lines
253 B
TOML
16 lines
253 B
TOML
edition = "2024"
|
|
style_edition = "2024"
|
|
max_width = 100
|
|
|
|
comment_width = 100
|
|
wrap_comments = true
|
|
|
|
tab_spaces = 4
|
|
hard_tabs = false
|
|
|
|
format_strings = true
|
|
use_field_init_shorthand = true
|
|
|
|
imports_granularity = "Crate"
|
|
group_imports = "StdExternalCrate"
|