about summary refs log tree commit diff
path: root/src/liballoc/collections/btree
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-28 11:11:08 +0200
committerGitHub <noreply@github.com>2019-07-28 11:11:08 +0200
commitb405aa2d0301c5fc448299501278ae2db4e15e50 (patch)
tree25f749e1f7d4c446983d7e3dd9b16eb0bf4b8dab /src/liballoc/collections/btree
parent2826bdcfa6fecc656294534162fb5990d3d53cf5 (diff)
parent124f6ef7cdea1083b0cbe0371e3f7fbe1152a9d1 (diff)
downloadrust-b405aa2d0301c5fc448299501278ae2db4e15e50.tar.gz
rust-b405aa2d0301c5fc448299501278ae2db4e15e50.zip
Rollup merge of #62806 - mati865:clippy, r=TimNN
Fix few Clippy warnings
Diffstat (limited to 'src/liballoc/collections/btree')
-rw-r--r--src/liballoc/collections/btree/map.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/liballoc/collections/btree/map.rs b/src/liballoc/collections/btree/map.rs
index 7cf779b3e72..1683b810556 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;
         }