Skip to content

Commit 44bf92b

Browse files
Update library/core/src/iter/range.rs
Co-authored-by: Carolyn Zech <[email protected]>
1 parent 16e6b0a commit 44bf92b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

library/core/src/iter/range.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,11 @@ impl Step for char {
526526
}
527527

528528
#[requires({
529-
let dist = (start as u32).checked_sub(count as u32);
530-
dist.is_some() &&
531-
((start as u32) < 0xE000 || dist.unwrap() >= 0xE000 ||
532-
dist.unwrap().checked_sub(0x800).is_some())
529+
(start as u32).checked_sub(count as u32).is_some_and(|dist|
530+
(start as u32) < 0xE000 ||
531+
dist >= 0xE000 ||
532+
dist.checked_sub(0x800).is_some()
533+
)
533534
})]
534535
#[inline]
535536
unsafe fn backward_unchecked(start: char, count: usize) -> char {

0 commit comments

Comments
 (0)