-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BraceStyle AlwaysNewLine for unsafe blocks
* Unsafe blocks can now get an opening brace on a new line * Add test case for unsafe blocks
- Loading branch information
1 parent
39fe0e1
commit 4a88598
Showing
3 changed files
with
90 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
tests/source/configs/brace_style/unsafe_always_next_line.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,25 @@ | ||
// rustfmt-brace_style: AlwaysNextLine | ||
// AlwaysNextLine brace style for unsafe blocks | ||
|
||
fn main() | ||
{ | ||
unsafe | ||
{ | ||
let good = (); | ||
} | ||
|
||
unsafe {} | ||
|
||
unsafe { | ||
let ugly = (); | ||
} | ||
|
||
unsafe /* f */ {} | ||
|
||
unsafe /* f*/ { | ||
let x = 1; | ||
} | ||
|
||
unsafe { /*lol*/ | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/target/configs/brace_style/unsafe_always_next_line.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,30 @@ | ||
// rustfmt-brace_style: AlwaysNextLine | ||
// AlwaysNextLine brace style for unsafe blocks | ||
|
||
fn main() | ||
{ | ||
unsafe | ||
{ | ||
let good = (); | ||
} | ||
|
||
unsafe {} | ||
|
||
unsafe | ||
{ | ||
let ugly = (); | ||
} | ||
|
||
unsafe /* f */ | ||
{ | ||
} | ||
|
||
unsafe /* f*/ | ||
{ | ||
let x = 1; | ||
} | ||
|
||
unsafe | ||
{ /*lol*/ | ||
} | ||
} |