Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
topecongiro committed Aug 28, 2017
1 parent 79f4dec commit 64901fe
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,15 @@ impl<'a> FmtVisitor<'a> {

let snippet =
self.snippet(mk_sp(self.last_pos, attr_lo.unwrap_or(first_stmt.span.lo)));
let len = CommentCodeSlices::new(&snippet).nth(0).and_then(
|(kind, _, s)| if kind == CodeCharKind::Normal {
s.rfind('\n')
} else {
None
},
);
let len = CommentCodeSlices::new(&snippet)
.nth(0)
.and_then(|(kind, _, s)| {
if kind == CodeCharKind::Normal {
s.rfind('\n')
} else {
None
}
});
if let Some(len) = len {
self.last_pos = self.last_pos + BytePos::from_usize(len);
}
Expand Down

0 comments on commit 64901fe

Please sign in to comment.