1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-14 11:07:59 +00:00

cat: use write_end_of_line to avoid duplicate code

This commit is contained in:
Daniel Hofstetter 2024-10-02 15:21:35 +02:00
parent 382e787d1c
commit db36051383

View file

@ -557,10 +557,7 @@ fn write_new_line<W: Write>(
write!(writer, "{0:6}\t", state.line_number)?; write!(writer, "{0:6}\t", state.line_number)?;
state.line_number += 1; state.line_number += 1;
} }
writer.write_all(options.end_of_line().as_bytes())?; write_end_of_line(writer, options.end_of_line().as_bytes(), is_interactive)?;
if is_interactive {
writer.flush()?;
}
} }
Ok(()) Ok(())
} }