use unwrap_unchecked where possible
This commit is contained in:
@@ -459,11 +459,8 @@ where
|
||||
debug_assert!(N <= iter.size_hint().1.unwrap_or(usize::MAX));
|
||||
debug_assert!(N <= iter.size_hint().0);
|
||||
|
||||
match collect_into_array(iter) {
|
||||
Some(array) => array,
|
||||
// SAFETY: covered by the function contract.
|
||||
None => unsafe { crate::hint::unreachable_unchecked() },
|
||||
}
|
||||
// SAFETY: covered by the function contract.
|
||||
unsafe { collect_into_array(iter).unwrap_unchecked() }
|
||||
}
|
||||
|
||||
/// Pulls `N` items from `iter` and returns them as an array. If the iterator
|
||||
|
||||
Reference in New Issue
Block a user