rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Format Rust code

Results 485 rustfmt issues
Sort by recently updated
recently updated
newest added

So, #8 says "format macros" (hard in general); #3445 suggests formatting macros using `{ .. }` braces as a `Block`; #2905 proposes formatting expression-like macros... ... general solutions are hard...

feature-request
a-macros

The libc crate has some macros, called `s!`, `f!`, etc. which take a series of items: ```rust f! { fn foo(); fn bar(); // ... } ``` I know that...

p-low
feature-request
a-macros

We have a rule that puts the second operand of a chain on the same line as the first if the first is 4 characters or less: ```rust fn foo()...

Tracking issue for unstable option: overflow_delimited_expr

unstable option

Currently, splitting behaviour appears to be mostly dependent on `max_width`, unless some specific option overrides/augments this. I don't fully understand why, either. Example, with `max_width = 140` (line = 105...

p-low
feature-request

When there are many arguments in the `#[derive(...)]` attribute, placing one argument per line makes the code vertically long and difficult to read. Could you consider adding an option to...

p-low
feature-request

From Yacin Tmimi: > The issue is that we're not accounting for cases where we don't have a body, or where the body is on the next line. Hopefully these...

pr-waiting-on-author

The following is rustfmt's formatting on 2025-02-17 4d91de4e48 (the version currently on the Rust Playground): ```rust impl where T: 'a + TransparentWrapper + ?Sized, I: Invariants, { pub(crate) fn transparent_wrapper_into_inner(...

poor-formatting

The problem occurs in the following code, note that the longest line is exactly 100 columns: ```rust pub trait Manager { fn attach_device(&self, seat_id: &str, sysfs_path: &str, interactive: bool) ->...

good first issue

Hi rustfmt team, This idea has come up regularly since 2017 — users keep asking for `#[derive(...)]` traits to be sorted automatically, just like imports. And each time, it’s been...

feature-request