diff options
| author | Mateusz Mikuła <matti@marinelayer.io> | 2019-07-18 14:22:22 +0200 |
|---|---|---|
| committer | Mateusz Mikuła <mati865@gmail.com> | 2019-07-18 15:14:56 +0200 |
| commit | 124f6ef7cdea1083b0cbe0371e3f7fbe1152a9d1 (patch) | |
| tree | f02efe11ba10b432de359b192f4575b52e9d28f3 /src/libstd | |
| parent | f93032c818da6482777e6fa35a535a494241a0f1 (diff) | |
| download | rust-124f6ef7cdea1083b0cbe0371e3f7fbe1152a9d1.tar.gz rust-124f6ef7cdea1083b0cbe0371e3f7fbe1152a9d1.zip | |
Fix clippy::len_zero warnings
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/unix/process/process_unix.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index a8d4d1181aa..3fbe9f3125f 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -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), } } diff --git a/src/libstd/sys/unix/process/process_unix.rs b/src/libstd/sys/unix/process/process_unix.rs index be38a1334ec..fc1e33137c8 100644 --- a/src/libstd/sys/unix/process/process_unix.rs +++ b/src/libstd/sys/unix/process/process_unix.rs @@ -277,7 +277,7 @@ impl Command { if self.get_gid().is_some() || self.get_uid().is_some() || self.env_saw_path() || - self.get_closures().len() != 0 { + !self.get_closures().is_empty() { return Ok(None) } |
