rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

[unstable option] empty_item_single_line

Open scampi opened this issue 6 years ago • 2 comments

Tracking issue for unstable option: empty_item_single_line

scampi avatar Feb 13 '19 22:02 scampi

Hi,

I hope this is the right place to report this:

When the option brace_style is set to "AlwaysNextLine", then empty_item_single_line=true does not work for traits:

// Expected:
pub trait SomeTrait {}

// Produced:
pub trait SomeTrait 
{
}

Removing the brace_style option from the .toml will make rustfmt produce the expected formatting.

Emoun avatar Feb 04 '20 10:02 Emoun

When using empty_item_single_line=false with the following code

mod hello {
}

fn foo() {
}

I get this result

mod hello {}

fn foo() {
}

but I would expect this result

mod hello {
}

fn foo() {
}

vladh avatar Jul 08 '24 16:07 vladh