Skip to content

Conversation

lopopolo
Copy link
Contributor

Adds impl<T> AsMut<[T]> for vec::IntoIter<T>, exposing the same
behavior as vec::IntoIter::as_mut_slice, which has been stable since
1.15.0.

https://doc.rust-lang.org/std/vec/struct.IntoIter.html#method.as_mut_slice

See #72583, which added the AsRef<[T]> impl to
vec::IntoIter. Adding this symmetric API.

As a trait impl, this will be insta-stable.

Adds `impl<T> AsMut<[T]> for vec::IntoIter<T>`, exposing the same
behavior as `vec::IntoIter::as_mut_slice`, which has been stable since
1.15.0.

https://doc.rust-lang.org/std/vec/struct.IntoIter.html#method.as_mut_slice

See #72583, which added the `AsRef<[T]>` impl to
`vec::IntoIter`. Adding this symmetric API.

As a trait impl, this will be insta-stable.
@rust-highfive
Copy link
Contributor

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 14, 2020
@Mark-Simulacrum Mark-Simulacrum added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Dec 15, 2020
@Mark-Simulacrum
Copy link
Member

r? @dtolnay for t-libs approval

@scottmcm scottmcm added the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Dec 16, 2020
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give a practical example where this would be needed in real code?

@lopopolo
Copy link
Contributor Author

I don't have a concrete use for this trait impl. It just struck me as a missing implementation of a core trait for which an equivalent, long-stable API already exists.

@dtolnay
Copy link
Member

dtolnay commented Dec 20, 2020

I think I would prefer not to add this in that case. Happy to reconsider if someone can show code where they would want to use this impl.

@dtolnay dtolnay closed this Dec 20, 2020
@lopopolo lopopolo deleted the vec-intoiter-asmut branch May 15, 2021 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants