1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-04 15:07:47 +00:00

refactor/polish ~ fix cargo clippy complaints (fatal/write_all)

This commit is contained in:
Roy Ivy III 2019-12-21 14:43:09 -06:00
parent 662db61336
commit a9b1a03b37
2 changed files with 2 additions and 2 deletions

View file

@ -146,7 +146,7 @@ fn more(matches: getopts::Matches) {
if sz == 0 {
break;
}
stdout().write(&buffer[0..sz]).unwrap();
stdout().write_all(&buffer[0..sz]).unwrap();
for byte in std::io::stdin().bytes() {
match byte.unwrap() {
b' ' => break,

View file

@ -61,7 +61,7 @@ impl<R: Read> PeekReader<R> {
fn write_to_tempbuffer(&mut self, bytes: &[u8]) {
// if temp_buffer is not empty, data has to be inserted in front
let org_buffer: Vec<_> = self.temp_buffer.drain(..).collect();
self.temp_buffer.write(bytes).unwrap();
self.temp_buffer.write_all(bytes).unwrap();
self.temp_buffer.extend(org_buffer);
}
}