Skip to content

Commit

Permalink
(LIB) printers.rs line.rs prefer write_all
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmoon79 committed Feb 3, 2025
1 parent 91a4274 commit 1b3b8d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/data/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ impl Line {
for linepart in &self.lineparts {
let slice = linepart.as_slice();
if raw {
match stdout_lock.write(slice) {
match stdout_lock.write_all(slice) {
Ok(_) => {}
Err(err) => {
e_err!(
Expand All @@ -884,7 +884,7 @@ impl Line {
for c in s.chars() {
let c_ = char_to_char_noraw(c);
let _cs = c_.encode_utf8(&mut dst);
match stdout_lock.write(&dst) {
match stdout_lock.write_all(&dst) {
Ok(_) => {}
Err(err) => {
e_err!("StdoutLock.write({:?}) error {}", &dst, err);
Expand Down
2 changes: 1 addition & 1 deletion src/printer/printers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ pub fn write_stdout(buffer: &[u8]) {
let mut stdout_lock = std::io::stdout().lock();
//let mut stderr_lock = std::io::stderr().lock();
let _si_lock = debug_print_guard();
match stdout_lock.write(buffer) {
match stdout_lock.write_all(buffer) {
Ok(_) => {}
Err(_err) => {
// XXX: this will print when this program stdout is truncated, like to due to `head`
Expand Down

0 comments on commit 1b3b8d3

Please sign in to comment.