cc: Don't add a space on an empty line that gets commented
@@ -43,7 +43,11 @@ fn comment(str: &str) -> String {
let line = &mut lines[i];
let convert = !((is_last && line.trim().is_empty()) || line.starts_with("///"));
if convert {
- *line = format!("/// {line}");
+ *line = if line.trim().is_empty() {
+ "///".into()
+ } else {
+ format!("/// {line}")
+ }
}
}
