Closed
Description
These feel like an omission to me, given how RangeArgument
is implemented for this type:
impl<T> SliceIndex<[T]> for (Bound<usize>, Bound<usize>) { ... }
impl SliceIndex<str> for (Bound<usize>, Bound<usize>) { ... }
And if we really want to go for feature parity, then RangeArgument
also has impls for (Bound<&T>, Bound<&T>)
, but I think that's mostly for the sake of methods like BTreeSet::range
, and it really doesn't make sense here.
Edit: Then again, considering that RangeArgument is going to have methods that return Bound<&T>
, maybe (Bound<&usize>, Bound<&usize>)
is worth it.
(secretly, I just want the standard library to implement my bounds-checking and length-computation for me in my n-dimensional array, so that I can just write vec![(); len][(start_bound, end_bound)].len()
and trust that it's correct. But shhhhhh, don't tell anyone)