1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 04:27:45 +00:00

comm: clean up line-end check

This commit is contained in:
Jeong YunWon 2021-06-11 21:59:16 +09:00
parent f104f8868c
commit 6003d95974

View file

@ -50,9 +50,8 @@ fn mkdelim(col: usize, opts: &ArgMatches) -> String {
}
fn ensure_nl(line: &mut String) {
match line.chars().last() {
Some('\n') => (),
_ => line.push('\n'),
if !line.ends_with('\n') {
line.push('\n');
}
}