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

Tracking issue for unstable option: `imports_granularity`. [Option documentation.](https://rust-lang.github.io/rustfmt/#imports_granularity) See [Processes.md, "Stabilising an Option"](https://github.com/rust-lang/rustfmt/blob/master/Processes.md#stabilising-an-option): - [x] Is the default value correct? - [x] The design and implementation of the option are...

unstable option

Tracking issue for unstable option: struct_field_align_threshold

unstable option

This PR adds an unstable `format_brace_macros` option for formatting brace `{}` delimited macro invocations that parse as valid Rust code, with fallback to existing behavior. ## Motivation Users consistently expect...

pr-on-hold

This code: ```rust let unformatted = { 1} // comment ; ``` or this: ```rust let unformatted = { 1} // comment ; ``` will pass through rustfmt unchanged. Removing...

a-comments
p-low

Hello! Tracking issue: #5435 This feature adds the option to put a space after '(' and before ')' on items surrounded by parentheses (on function/method declarations, calls, ...). Tips on...

pr-not-reviewed
pr-on-hold

rustfmt 1.5.1-nightly (9243168 2022-08-31) rustfmt.toml: ```toml format_macro_matchers = true format_macro_bodies = true format_strings = false ``` code won't format ```rust macro_rules! test { ($( $v:expr ),*) => { $( $v),*...

p-low
feature-request
a-macros

This pull request adapts the plan 2 of [@ytmimi's comment](https://github.com/rust-lang/rustfmt/issues/5533#issuecomment-1238224735), and it won't touch any comment which is not a documentation comment now. However, it did not fixed the root...

pr-ready-to-merge

## Meta - **rustfmt version**: `rustfmt 1.5.1-nightly (b44197ab 2022-09-05)` - **Minimum reproducible repo**: - **rustfmt configuration**: ```toml format_code_in_doc_comments = true ``` ## Description After enabling `format_code_in_doc_comments`, rustfmt formats the following...

good first issue
a-comments
only-with-option

My config: ```toml unstable_features = true error_on_line_overflow = true error_on_unformatted = true format_code_in_doc_comments = true format_strings = true hex_literal_case = "Lower" imports_granularity = "Crate" normalize_comments = true reorder_impl_items = true...

only-with-option

Fixes #5526 When creating new contexts with `FmtVisitor::get_context` we set the value of `ctx.inside_macro` based on the `parent_context` if it exists. This helps us remember that we're inside of a...

pr-not-reviewed