Auto merge of #130867 - michirakara:steps_between, r=dtolnay

distinguish overflow and unimplemented in Step::steps_between
This commit is contained in:
bors 2024-11-22 10:54:22 +00:00
commit f1e0752404
6 changed files with 94 additions and 79 deletions

View file

@ -638,7 +638,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())
}