Merge pull request #200 from sinhpham/master
Fix https://github.com/nrc/rustfmt/issues/190
This commit is contained in:
commit
cf046b734c
@ -43,6 +43,10 @@ impl<'a> FmtVisitor<'a> {
|
||||
self.codemap.lookup_char_pos(end));
|
||||
|
||||
if start == end {
|
||||
// Do nothing if this is the beginning of the file.
|
||||
if start == BytePos(0) {
|
||||
return;
|
||||
}
|
||||
process_last_snippet(self, "", "");
|
||||
return;
|
||||
}
|
||||
|
2
tests/target/no_new_line_beginning.rs
Normal file
2
tests/target/no_new_line_beginning.rs
Normal file
@ -0,0 +1,2 @@
|
||||
fn main() {
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user