Skip to content

Commit

Permalink
Fix last doc code comment being removed if it only had one character
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 6, 2021
1 parent d22dd65 commit e8f1d57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/util/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn beautify_doc_string(data: Symbol) -> Symbol {
i += 1;
}
// like the first, a last line of all stars should be omitted
if j > i && lines[j - 1].chars().skip(1).all(|c| c == '*') {
if j > i && !lines[j - 1].is_empty() && lines[j - 1].chars().all(|c| c == '*') {
j -= 1;
}

Expand Down

0 comments on commit e8f1d57

Please sign in to comment.