Merge pull request #6764 from cakebaker/cat_remove_duplicate_code

cat: use `write_end_of_line()`  to avoid duplicate code
This commit is contained in:
Sylvestre Ledru
2024-10-03 08:50:19 +02:00
committed by GitHub
+1 -4
View File
@@ -557,10 +557,7 @@ fn write_new_line<W: Write>(
write!(writer, "{0:6}\t", state.line_number)?;
state.line_number += 1;
}
writer.write_all(options.end_of_line().as_bytes())?;
if is_interactive {
writer.flush()?;
}
write_end_of_line(writer, options.end_of_line().as_bytes(), is_interactive)?;
}
Ok(())
}