diff options
author | Trinity Pointard <trinity.pointard@gmail.com> | 2021-04-09 02:32:42 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-05-03 22:11:41 +0200 |
commit | f05bb111c2e7dd77f2b34b82892bbfa8e6a063c1 (patch) | |
tree | 0e093982ad6e30a440dcdbd9d8e47c4e75b9d198 /src/rpc/ring.rs | |
parent | 88925ebe2210a8382b4d353fcab15d2b5c345efb (diff) | |
download | garage-f05bb111c2e7dd77f2b34b82892bbfa8e6a063c1.tar.gz garage-f05bb111c2e7dd77f2b34b82892bbfa8e6a063c1.zip |
fix clippy warnings on util and rpc
Diffstat (limited to 'src/rpc/ring.rs')
-rw-r--r-- | src/rpc/ring.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rpc/ring.rs b/src/rpc/ring.rs index bffd7f1f..d371bb64 100644 --- a/src/rpc/ring.rs +++ b/src/rpc/ring.rs @@ -141,8 +141,7 @@ impl Ring { if i_round >= node_info.capacity { continue; } - for pos2 in *pos..q.len() { - let qv = q[pos2]; + for (pos2, &qv) in q.iter().enumerate().skip(*pos) { if partitions[qv].len() != rep { continue; } @@ -205,7 +204,7 @@ impl Ring { for (i, entry) in self.ring.iter().enumerate() { ret.push((i as u16, entry.location)); } - if ret.len() > 0 { + if !ret.is_empty() { assert_eq!(ret[0].1, [0u8; 32].into()); } @@ -234,6 +233,6 @@ impl Ring { assert_eq!(partition_top & PARTITION_MASK_U16, top & PARTITION_MASK_U16); assert!(n <= partition.nodes.len()); - partition.nodes[..n].iter().cloned().collect::<Vec<_>>() + partition.nodes[..n].to_vec() } } |