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:
parent
662db61336
commit
a9b1a03b37
2 changed files with 2 additions and 2 deletions
|
@ -146,7 +146,7 @@ fn more(matches: getopts::Matches) {
|
||||||
if sz == 0 {
|
if sz == 0 {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
stdout().write(&buffer[0..sz]).unwrap();
|
stdout().write_all(&buffer[0..sz]).unwrap();
|
||||||
for byte in std::io::stdin().bytes() {
|
for byte in std::io::stdin().bytes() {
|
||||||
match byte.unwrap() {
|
match byte.unwrap() {
|
||||||
b' ' => break,
|
b' ' => break,
|
||||||
|
|
|
@ -61,7 +61,7 @@ impl<R: Read> PeekReader<R> {
|
||||||
fn write_to_tempbuffer(&mut self, bytes: &[u8]) {
|
fn write_to_tempbuffer(&mut self, bytes: &[u8]) {
|
||||||
// if temp_buffer is not empty, data has to be inserted in front
|
// if temp_buffer is not empty, data has to be inserted in front
|
||||||
let org_buffer: Vec<_> = self.temp_buffer.drain(..).collect();
|
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);
|
self.temp_buffer.extend(org_buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue