forked from rust-lang/rustfmt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix empty trim_newline panic, add impl macro test
- Loading branch information
Showing
3 changed files
with
21 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,10 @@ mod b { | |
} | ||
} | ||
} | ||
|
||
impl Foo { add_fun!(); } | ||
|
||
impl Blah { | ||
fn boop() {} | ||
add_fun!(); | ||
} |
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 |
---|---|---|
|
@@ -63,3 +63,12 @@ mod b { | |
} | ||
} | ||
} | ||
|
||
impl Foo { | ||
add_fun!(); | ||
} | ||
|
||
impl Blah { | ||
fn boop() {} | ||
add_fun!(); | ||
} |
I believe that either start and end will both be None or neither will, so if you want the whole span in the None case you can change the 0 in the unwrap_or case to input.len() - 1. Or you could match on the input.find results.