Skip to content

Commit

Permalink
Fixed semicolon getting moved into comment (fixes rust-lang#4646)
Browse files Browse the repository at this point in the history
  • Loading branch information
vallentin committed Jan 17, 2021
1 parent a97fd77 commit c8301e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/formatting/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ impl<'a> FmtVisitor<'a> {
FnBraceStyle::None,
)?;

if last_line_contains_single_line_comment(&result) {
result.push('\n');
}

// Re-attach semicolon
result.push(';');

Expand Down

0 comments on commit c8301e6

Please sign in to comment.