1
Fork 0

Fix last doc code comment being removed if it only had one character

This commit is contained in:
Guillaume Gomez 2021-11-06 19:41:33 +01:00
parent d22dd65835
commit e8f1d57d80

View file

@ -38,7 +38,7 @@ pub fn beautify_doc_string(data: Symbol) -> Symbol {
i += 1; i += 1;
} }
// like the first, a last line of all stars should be omitted // 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; j -= 1;
} }