Skip to content

Commit

Permalink
Add more tests for struct_field_align_threshold and trailing_comma
Browse files Browse the repository at this point in the history
  • Loading branch information
cassaundra authored and calebcartwright committed Mar 6, 2022
1 parent ee13051 commit ab9f2a8
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
File renamed without changes.
14 changes: 14 additions & 0 deletions tests/source/issue-4791/trailing_comma.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// rustfmt-struct_field_align_threshold: 30
// rustfmt-trailing_comma: Always

struct Foo {
group_a: u8,

group_b: u8
}

struct Bar {
group_a: u8,

group_b: u8,
}
File renamed without changes.
8 changes: 8 additions & 0 deletions tests/target/issue-4791/no_trailing_comma.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// rustfmt-struct_field_align_threshold: 0
// rustfmt-trailing_comma: Never

pub struct Baz {
group_a: u8,

group_b: u8
}
14 changes: 14 additions & 0 deletions tests/target/issue-4791/trailing_comma.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// rustfmt-struct_field_align_threshold: 30
// rustfmt-trailing_comma: Always

struct Foo {
group_a: u8,

group_b: u8,
}

struct Bar {
group_a: u8,

group_b: u8,
}

0 comments on commit ab9f2a8

Please sign in to comment.