diff options
| author | Tamir Duberstein <tamird@gmail.com> | 2015-03-24 16:53:34 -0700 |
|---|---|---|
| committer | Tamir Duberstein <tamird@gmail.com> | 2015-04-14 20:26:03 -0700 |
| commit | 29ac04402d53d358a1f6200bea45a301ff05b2d1 (patch) | |
| tree | b54ff9c5f2b99a0197147875cf3c5377d8a09cf4 /src/libstd | |
| parent | 16e1fcead14628701e1b10b9d00c898d748db2ed (diff) | |
| download | rust-29ac04402d53d358a1f6200bea45a301ff05b2d1.tar.gz rust-29ac04402d53d358a1f6200bea45a301ff05b2d1.zip | |
Positive case of `len()` -> `is_empty()`
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/set.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process2.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index 6b0546b1ee7..62c03389b24 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -430,7 +430,7 @@ impl<T, S> HashSet<T, S> /// assert!(!v.is_empty()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub fn is_empty(&self) -> bool { self.map.len() == 0 } + pub fn is_empty(&self) -> bool { self.map.is_empty() } /// Clears the set, returning all elements in an iterator. #[inline] diff --git a/src/libstd/sys/windows/process2.rs b/src/libstd/sys/windows/process2.rs index 74953921921..3d5c9867a6f 100644 --- a/src/libstd/sys/windows/process2.rs +++ b/src/libstd/sys/windows/process2.rs @@ -381,7 +381,7 @@ fn make_command_line(prog: &OsStr, args: &[OsString]) -> Vec<u16> { // it will be dropped entirely when parsed on the other end. let arg_bytes = &arg.as_inner().inner.as_inner(); let quote = arg_bytes.iter().any(|c| *c == b' ' || *c == b'\t') - || arg_bytes.len() == 0; + || arg_bytes.is_empty(); if quote { cmd.push('"' as u16); } |
