Skip to content

blank_lines_lower_bound ignores impl/traits functions #5067

Open
@Ricky12Awesome

Description

@Ricky12Awesome

Version: rustfmt 2.0.0-rc.2-nightly (cc5521d9 2021-10-23)
rustfmt.toml:

tab_spaces = 2
blank_lines_lower_bound = 1

Before

fn a() {}
fn b() {}
mod foo {
  fn a() {}
  fn b() {}
}
struct Foo;
impl Foo {
  fn a() {}
  fn b() {}
}
trait Bar {
  fn a();
  fn b();
}

After (currently)

fn a() {}

fn b() {}

mod foo {

  fn a() {}

  fn b() {}
}

struct Foo;

impl Foo {
  fn a() {}
  fn b() {}
}

trait Bar {
  fn a();
  fn b();
}

After (what I think it should be formatted as)

fn a() {}

fn b() {}

mod foo {
  fn a() {}

  fn b() {}
}

struct Foo;

impl Foo {
  fn a() {}

  fn b() {}
}

trait Bar {
  fn a();
  
  fn b();
}

Related to #2954, also would be nice to have this #3382 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    only-with-optionrequires a non-default option value to reproducep-low

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions