rustfmt
rustfmt copied to clipboard
Format Rust code
# Summary Currently `alloc`, `core`, and `std` imports are always reordered lexicographically (when they will be reordered). However, at least when a reordered group only contains these standard library crates,...
I'm seeing this behavior in rustfmt 1.6.0-nightly (c469197b 2023-08-22): ```rust // Before (correct in stable) type AAAAAAAAAAAAA: BBBBBBBBBBBBBBB< CCCCCCCCCCCCCCCCC, DDDDDDDDDDDDDDDDD, EEEEEEEEEEEEEEEEE, FFFFFFFFFFFFFFFFF, GGGGGGGGGGGGGGGGG, HHHHHHHHHHHHHHHHH, IIIIIIIIIIIIIIIII, >; // After (hopefully not...
Tracking issue for unstable option: reorder_impl_items
This ports https://github.com/rust-lang/rustfmt/pull/4745 to the current master branch. That led to a bunch of test failures so I hacked around until they were all gone... but the codebase is entirely...
Fix #5662. Previously, an `enum` item containing an attribute (rustdoc or macro for example) would be considered multi-line, thus forcing the formatting strategy of all the items in the enum...
Formatting inside the `lazy_static!` macro did not work when the macro was used with the crate name: `lazy_static::lazy_static!`. For example, that code is formatted well. ``` use lazy_static::lazy_static; ... lazy_static!...
Fix #6277 by filtering list use and renormalize if needed
Minimum reproducible example: ```rust fn main() { let foo = // 114514 if true { 1919 } else { 810 }; } ``` Note the extra whitespace after `=`. Version:...
fixes #6267 The `ForeignItemKind::Static(_)` match arm in the `ast::ForeignItem` `Rewrite` impl duplicated some of the logic already implemented in `rewrite_static`, so reusing it helps centralize the logic. The other benefit...