Skip to content

Commit 5ae8316

Browse files
authored
Merge pull request #6764 from cakebaker/cat_remove_duplicate_code
cat: use `write_end_of_line()` to avoid duplicate code
2 parents 2d90bda + db36051 commit 5ae8316

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/uu/cat/src/cat.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,7 @@ fn write_new_line<W: Write>(
557557
write!(writer, "{0:6}\t", state.line_number)?;
558558
state.line_number += 1;
559559
}
560-
writer.write_all(options.end_of_line().as_bytes())?;
561-
if is_interactive {
562-
writer.flush()?;
563-
}
560+
write_end_of_line(writer, options.end_of_line().as_bytes(), is_interactive)?;
564561
}
565562
Ok(())
566563
}

0 commit comments

Comments
 (0)