mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-27 16:07:46 +00:00
"cargo fmt" works fine but "rustfmt" fails to format some files. $ rustfmt crates/ide-db/src/search.rs error: let chains are only allowed in Rust 2024 or later --> /home/johannes/git/rust-analyzer/crates/ide-db/src/search.rs:298:12 | 298 | if let &Definition::Module(module) = self | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I guess I could work around this by setting my format command to "cargo fmt -- $filename" instead of "rustfmt $filename". But it'd be nice if this worked OOTB. Make it so by adding specifying the edition in rustfmt.toml. We already have several other places specifying the edition. changelog internal
4 lines
69 B
TOML
4 lines
69 B
TOML
edition = "2024"
|
|
reorder_modules = true
|
|
use_small_heuristics = "Max"
|