change end to last

This commit is contained in:
Jeremy Smart
2025-07-31 23:27:02 -04:00
parent 51ff895062
commit 8d0c07f1a1
20 changed files with 245 additions and 53 deletions

View File

@@ -130,7 +130,22 @@ impl<I: Idx, T> IntoSliceIdx<I, [T]> for core::range::RangeFrom<I> {
impl<I: Idx, T> IntoSliceIdx<I, [T]> for core::range::RangeInclusive<I> {
type Output = core::range::RangeInclusive<usize>;
#[inline]
#[cfg(bootstrap)]
fn into_slice_idx(self) -> Self::Output {
core::range::RangeInclusive { start: self.start.index(), end: self.end.index() }
}
#[inline]
#[cfg(not(bootstrap))]
fn into_slice_idx(self) -> Self::Output {
core::range::RangeInclusive { start: self.start.index(), last: self.last.index() }
}
}
#[cfg(all(feature = "nightly", not(bootstrap)))]
impl<I: Idx, T> IntoSliceIdx<I, [T]> for core::range::RangeToInclusive<I> {
type Output = core::range::RangeToInclusive<usize>;
#[inline]
fn into_slice_idx(self) -> Self::Output {
core::range::RangeToInclusive { last: self.last.index() }
}
}