Skip to content

Commit 7a3fadb

Browse files
committed
Don't prefix empty comments lines with a space
1 parent 9401fb0 commit 7a3fadb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/template.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ pub fn populate_env(
105105
};
106106

107107
Ok(s.lines()
108-
.format_with("\n", |line, f| f(&format_args!("{prefix} {line}")))
108+
.format_with("\n", |line, f| {
109+
// if the line is empty, we don't want to spit out a `/// `, we want to spit out a `///`
110+
let space = if line.is_empty() { "" } else { " " };
111+
f(&format_args!("{prefix}{space}{line}"))
112+
})
109113
.to_string())
110114
},
111115
);

0 commit comments

Comments
 (0)