Skip to content

Commit 7192515

Browse files
committed
Convert manual loop to while let
1 parent 78c516d commit 7192515

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/dynamic_set.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,8 @@ impl Set {
9494

9595
let mut current: &mut Option<Box<Entry>> = &mut self.buckets[bucket_index];
9696

97-
loop {
98-
let entry_ptr: *mut Entry = match current.as_mut() {
99-
Some(entry) => &mut **entry,
100-
None => break,
101-
};
97+
while let Some(entry_ptr) = current.as_mut() {
98+
let entry_ptr: *mut Entry = &mut **entry_ptr;
10299
if entry_ptr == ptr {
103100
mem::drop(mem::replace(current, unsafe {
104101
(*entry_ptr).next_in_bucket.take()

0 commit comments

Comments
 (0)