Skip to content

Commit 434d7ac

Browse files
committed
Avoid let-else for MSRV's sake
1 parent 5be552d commit 434d7ac

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/map/slice.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,12 @@ impl<K, V> Slice<K, V> {
292292
// SAFETY: Can't allow duplicate indices as we would return several mutable refs to the same data.
293293
let len = self.len();
294294
for i in 0..N {
295-
let Some(idx) = indices[i] else {
296-
continue;
297-
};
298-
if idx >= len {
299-
return Err(GetDisjointMutError::IndexOutOfBounds);
300-
} else if indices[..i].contains(&Some(idx)) {
301-
return Err(GetDisjointMutError::OverlappingIndices);
295+
if let Some(idx) = indices[i] {
296+
if idx >= len {
297+
return Err(GetDisjointMutError::IndexOutOfBounds);
298+
} else if indices[..i].contains(&Some(idx)) {
299+
return Err(GetDisjointMutError::OverlappingIndices);
300+
}
302301
}
303302
}
304303

0 commit comments

Comments
 (0)