Skip to content

Implement Index for SliceIndex types for str #55603

Closed
@alercah

Description

@alercah

While writing a generic implementation today, I was surprised that you can't do s[i] for i: SliceIndex<S>, if s is of slice type &S. Doing s.get(i).unwrap() is an easy enough workaround, but feels really bad. Replacing the various explicit impls with one for SliceIndex would feel much nicer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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