Fix clippy::len_zero warnings
This commit is contained in:
parent
f93032c818
commit
124f6ef7cd
4 changed files with 8 additions and 8 deletions
|
@ -1923,7 +1923,7 @@ impl<T: Read, U: Read> Read for Chain<T, U> {
|
|||
fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
|
||||
if !self.done_first {
|
||||
match self.first.read(buf)? {
|
||||
0 if buf.len() != 0 => self.done_first = true,
|
||||
0 if !buf.is_empty() => self.done_first = true,
|
||||
n => return Ok(n),
|
||||
}
|
||||
}
|
||||
|
@ -1955,7 +1955,7 @@ impl<T: BufRead, U: BufRead> BufRead for Chain<T, U> {
|
|||
fn fill_buf(&mut self) -> Result<&[u8]> {
|
||||
if !self.done_first {
|
||||
match self.first.fill_buf()? {
|
||||
buf if buf.len() == 0 => { self.done_first = true; }
|
||||
buf if buf.is_empty() => { self.done_first = true; }
|
||||
buf => return Ok(buf),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue