Skip to content

Commit a8fc73e

Browse files
committed
Avoid let-else for MSRV's sake
(cherry picked from commit 434d7ac6d122cf27dce979eb3888e362853dfb2d)
1 parent b0abe31 commit a8fc73e

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
@@ -286,13 +286,12 @@ impl<K, V> Slice<K, V> {
286286
// SAFETY: Can't allow duplicate indices as we would return several mutable refs to the same data.
287287
let len = self.len();
288288
for i in 0..N {
289-
let Some(idx) = indices[i] else {
290-
continue;
291-
};
292-
if idx >= len {
293-
return Err(GetDisjointMutError::IndexOutOfBounds);
294-
} else if indices[..i].contains(&Some(idx)) {
295-
return Err(GetDisjointMutError::OverlappingIndices);
289+
if let Some(idx) = indices[i] {
290+
if idx >= len {
291+
return Err(GetDisjointMutError::IndexOutOfBounds);
292+
} else if indices[..i].contains(&Some(idx)) {
293+
return Err(GetDisjointMutError::OverlappingIndices);
294+
}
296295
}
297296
}
298297

0 commit comments

Comments
 (0)