forked from rust-lang/rustfmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rust-lang#3284 from scampi/issue-3270
recognize strings inside comments in order to avoid indenting them
- Loading branch information
Showing
9 changed files
with
150 additions
and
38 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
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
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
// rustfmt-version: One | ||
|
||
pub fn main() { | ||
/* let s = String::from( | ||
" | ||
hello | ||
world | ||
", | ||
); */ | ||
|
||
assert_eq!(s, "\nhello\nworld\n"); | ||
} |
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,12 @@ | ||
// rustfmt-version: Two | ||
|
||
pub fn main() { | ||
/* let s = String::from( | ||
" | ||
hello | ||
world | ||
", | ||
); */ | ||
|
||
assert_eq!(s, "\nhello\nworld\n"); | ||
} |
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
// rustfmt-version: Two | ||
|
||
fn test() { | ||
/* | ||
a | ||
*/ | ||
let x = 42; | ||
/* | ||
aaa | ||
"line 1 | ||
line 2 | ||
line 3" | ||
*/ | ||
aaa | ||
"line 1 | ||
line 2 | ||
line 3" | ||
*/ | ||
let x = 42; | ||
} |
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,12 @@ | ||
// rustfmt-version: One | ||
|
||
pub fn main() { | ||
/* let s = String::from( | ||
" | ||
hello | ||
world | ||
", | ||
); */ | ||
|
||
assert_eq!(s, "\nhello\nworld\n"); | ||
} |
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,12 @@ | ||
// rustfmt-version: Two | ||
|
||
pub fn main() { | ||
/* let s = String::from( | ||
" | ||
hello | ||
world | ||
", | ||
); */ | ||
|
||
assert_eq!(s, "\nhello\nworld\n"); | ||
} |
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,13 @@ | ||
// rustfmt-wrap_comments: true | ||
// rustfmt-version: Two | ||
|
||
// check that a line below max_width does not get over the limit when wrapping | ||
// it in a block comment | ||
fn func() { | ||
let x = 42; | ||
/* | ||
let something = "one line line line line line line line line line line line line line | ||
two lines | ||
three lines"; | ||
*/ | ||
} |