Skip to content

impl<T> SliceIndex<[T]> for (Bound<usize>, Bound<usize>) #49976

Closed
@ExpHP

Description

@ExpHP

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions