Skip to content
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

Fix #21328 #21388

Merged
merged 3 commits into from
Jan 21, 2015
Merged

Fix #21328 #21388

merged 3 commits into from
Jan 21, 2015

Conversation

aochagavia
Copy link
Contributor

Fixes #21328

Breaking change: VecMap::into_iter now consumes the VecMap. To fix it you should pass the VecMap by value instead of by reference.

[breaking-change]

r? @gankro

This is a breaking change. To fix it you should pass the VecMap by value
instead of by reference.

[breaking-change]
/// The iterator's element type is `(uint, &'r V)`.
///
/// # Examples
/// # Example
Copy link
Contributor

Choose a reason for hiding this comment

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

Examples is the convention, regardless of number of exmaples.

@Gankra
Copy link
Contributor

Gankra commented Jan 19, 2015

I would suggest against ExactSizeIterator; len is an O(n) operation for VecMap.

@Gankra
Copy link
Contributor

Gankra commented Jan 19, 2015

Needs tests

@aochagavia
Copy link
Contributor Author

@gankro I fixed the issues you pointed out and added a test

@Gankra
Copy link
Contributor

Gankra commented Jan 19, 2015

Woah a run-pass test is way overkill. Just need some basic tests in the module that make sure the iterators produce correct output (and e.g. drain actually empties the parent). Check out VecMap's tests and other collections for examples (we're actually a bit inconsistent in how we test iterators).

@aochagavia
Copy link
Contributor Author

@gankro Sorry for the run-pass test 😋 ... I have added it as a normal test.

@Gankra
Copy link
Contributor

Gankra commented Jan 19, 2015

@bors: r+ b409

@aochagavia
Copy link
Contributor Author

Maybe it needs a longer string?

See here: #21386

@Gankra
Copy link
Contributor

Gankra commented Jan 19, 2015

It registered the last one

@Gankra
Copy link
Contributor

Gankra commented Jan 19, 2015

Also I clearly nailed it on my first try.

Anyone who claims otherwise is clearly a liar?

@Gankra
Copy link
Contributor

Gankra commented Jan 19, 2015

@bors rollup

@aochagavia
Copy link
Contributor Author

Thanks for reviewing!

@Gankra
Copy link
Contributor

Gankra commented Jan 19, 2015

Thanks for contributing! 🎊

barosl added a commit to barosl/rust that referenced this pull request Jan 20, 2015
**Breaking change**: `VecMap::into_iter` now consumes the `VecMap`. To fix it you should pass the VecMap by value instead of by reference.

[breaking-change]

r? @gankro
@bors bors merged commit b4090aa into rust-lang:master Jan 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VecMap::into_iter shouldn't be taking a &mut self
3 participants