distinguish overflow and unimplemented in Step::steps_between

This commit is contained in:
michirakara 2024-09-25 18:09:30 -07:00 committed by David Tolnay
parent b5117538e9
commit de741d2093
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
6 changed files with 94 additions and 79 deletions

View file

@ -624,7 +624,7 @@ impl AddAssign for Size {
#[cfg(feature = "nightly")]
impl Step for Size {
#[inline]
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
u64::steps_between(&start.bytes(), &end.bytes())
}