Skip to content

Commit

Permalink
refactor: slice into string instead of stripping suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
amr-crabnebula committed Oct 18, 2023
1 parent 7ef6b7c commit 87a8c00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/packager/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl CommandExt for Command {
if let Ok(0) = stdout.read_line(&mut buf) {
break;
}
tracing::debug!("{}", buf.strip_suffix('\n').unwrap_or_else(|| &buf));
tracing::debug!("{}", &buf[0..buf.len() - 1]);
lines.extend(buf.as_bytes());
}
});
Expand All @@ -59,7 +59,7 @@ impl CommandExt for Command {
if let Ok(0) = stderr.read_line(&mut buf) {
break;
}
tracing::debug!("{}", buf.strip_suffix('\n').unwrap_or_else(|| &buf));
tracing::debug!("{}", &buf[0..buf.len() - 1]);
lines.extend(buf.as_bytes());
}
});
Expand Down

0 comments on commit 87a8c00

Please sign in to comment.