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/liballoc | |
| parent | f93032c818da6482777e6fa35a535a494241a0f1 (diff) | |
Fix clippy::len_zero warnings
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/collections/btree/map.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/liballoc/collections/btree/map.rs b/src/liballoc/collections/btree/map.rs index d466948a017..8bd1a3f44a3 100644 --- a/src/liballoc/collections/btree/map.rs +++ b/src/liballoc/collections/btree/map.rs @@ -200,7 +200,7 @@ impl<K: Clone, V: Clone> Clone for BTreeMap<K, V> { } } - if self.len() == 0 { + if self.is_empty() { // Ideally we'd call `BTreeMap::new` here, but that has the `K: // Ord` constraint, which this method lacks. BTreeMap { @@ -759,12 +759,12 @@ impl<K: Ord, V> BTreeMap<K, V> { #[stable(feature = "btree_append", since = "1.11.0")] pub fn append(&mut self, other: &mut Self) { // Do we have to append anything at all? - if other.len() == 0 { + if other.is_empty() { return; } // We can just swap `self` and `other` if `self` is empty. - if self.len() == 0 { + if self.is_empty() { mem::swap(self, other); return; } |
