Skip to content

VecMap::into_iter shouldn't be taking a &mut self #21328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
erickt opened this issue Jan 17, 2015 · 3 comments · Fixed by #21388
Closed

VecMap::into_iter shouldn't be taking a &mut self #21328

erickt opened this issue Jan 17, 2015 · 3 comments · Fixed by #21388
Labels
A-collections Area: `std::collections`

Comments

@erickt
Copy link
Contributor

erickt commented Jan 17, 2015

cc @gankro

I'm in the process of IntoIter-ifying the collections, and I've discovered that the VecMap::into_iter takes a &mut self instead of the convention of into_* consuming the value. It's also marked stable, even though the type itself is marked unstable. Should this instead be a candidate for the drain method discussed in the collection reform trait?

@Gankra
Copy link
Contributor

Gankra commented Jan 17, 2015

Yeah this is just a mistake. Feel free to fix it to match conventions.

@kmcallister kmcallister added A-collections Area: `std::collections` A-libs labels Jan 17, 2015
@aochagavia
Copy link
Contributor

Just to be clear, the solution to this is to make into_iter consume the value and introduce a drain function (and iterator). Is this right or am I missing something?

@Gankra
Copy link
Contributor

Gankra commented Jan 18, 2015

Yep!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-collections Area: `std::collections`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants