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:
parent
f104f8868c
commit
6003d95974
1 changed files with 2 additions and 3 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue