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

Renaming of the Iter types as in RFC #344 #20056

Merged
merged 2 commits into from
Dec 23, 2014
Merged

Conversation

1wilkens
Copy link
Contributor

libcore: slice::Items -> slice::Iter, slice::MutItems -> slice::IterMut
libcollections: *::Items -> *::Iter, *::MoveItems -> *::IntoIter, *::MutItems -> *::IterMut

This is of course a [breaking-change].

Some Unstable attributes of functions affected might not longer need the attribute since the return type is now correctly named.

libstd::collections::hash is left out since the rename there is handled in a different PR as far as I know.

@gankro @aturon

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@1wilkens
Copy link
Contributor Author

Build/Tests are still running but I am optimistic :)

@csouth3
Copy link
Contributor

csouth3 commented Dec 20, 2014

Awesome work! :)
A couple of things that I see:
Looks like #19993 is taking care of the renaming for HashSet, but I think that you could do it for HashMap. Also, BTreeSet has set operation iterators that I think also should be renamed to match the methods that create them. E.g. in BTreeSet:
DifferenceItems -> Difference
SymDifferenceItems -> SymmetricDifference
UnionItems -> Union
IntersectionItems -> Intersection

@aturon
Copy link
Member

aturon commented Dec 20, 2014

See #20061 for slice/vec

@1wilkens
Copy link
Contributor Author

@csouth3 Right, I'm on it!

@1wilkens
Copy link
Contributor Author

I feel like I messed up the commits.. I rebased my fork from rust/master but now the PR includes these commits. That is not supposed to happen right?

@Gankra
Copy link
Contributor

Gankra commented Dec 20, 2014

Normally I would git pull --rebase upstream master on the branch I want to update. Seems something went wrong for you, yeah. One thing you can do is git reset --hard bcfd6214e9c76263fa31 (I highly recommend creating a duplicate branch before doing this, in case something goes wrong).

@1wilkens
Copy link
Contributor Author

Additional renames are up. Let me know if something is missing/should be changed

@csouth3
Copy link
Contributor

csouth3 commented Dec 20, 2014

New work looks good! Also, as @aturon mentioned, looks like he handles this work for slice (both libcollections and libcore) and vec in #20061. Unfortunately I think this means (though I'd wait for confirmation from him or @gankro) that you'll probably have to undo your changes to these files since most likely that pull request will land before yours :/

@Gankra
Copy link
Contributor

Gankra commented Dec 21, 2014

I'm inclined to let this be first-come-first-serve, but aturon's gone for the holidays so that might be tricky.

Currently finishing up my exams; will review monday if no one else does first.

@1wilkens
Copy link
Contributor Author

Yeah I skimmed through his PR. Would not be the biggest deal for me, since I had the learning experience anyway and the rest should still be useful.
He mentioned that he changed the structure of various files as well, so it might be more work to rebase his changes on my work instead of the other way round.
Like I said, it doesn't really matter to me, I am just happy I could contribute something useful :)

@csouth3
Copy link
Contributor

csouth3 commented Dec 21, 2014

Sounds good 👍
After taking another glance at his PR actually, looks like he goes to town on the rest of the iterators in libcore/slice.rs (for example the various Split and Chunk iters), but some of the changes going on with those guys are more significant refactors than just renaming, so it actually probably could work to land the renaming changes in this PR and then leave aturon's PR to do the more heavy lifting, so to speak (his already needs a rebase anyway)...

But, after all, I don't really have any say here, so might as well just wait until Gankro can review after the weekend.

Oh, and thanks again for doing this! :D

@alexcrichton
Copy link
Member

Amazing! Thanks @MrFloya!

I agree with @gankro that the queue is basically a first-come-first-serve kinda world, so we'll see who has to rebase first! (dun dun dun!)

@1wilkens 1wilkens force-pushed the iter_rename branch 2 times, most recently from 7cccfd9 to ad623d4 Compare December 21, 2014 13:08
@1wilkens
Copy link
Contributor Author

Okay so I rebased. This needs another r+ then right?

@alexcrichton
Copy link
Member

Needs a rebase

libcore: slice::Items -> slice::Iter, slice::MutItems -> slice::IterMut
libcollections: *::Items -> *::Iter, *::MoveItems -> *::IntoIter, *::MutItems -> *::IterMut

This is of course a [breaking-change].
@1wilkens
Copy link
Contributor Author

Should be okay now. r?

#[stable]
impl<'a, T> Clone for Items<'a, T> {
fn clone(&self) -> Items<'a, T> { *self }
#[experimental = "needs review"]
Copy link
Contributor

Choose a reason for hiding this comment

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

?

libcollections:
    AbsEntries -> AbsIter, Entries -> Iter, MoveEntries -> IntoIter, MutEntries -> IterMut
    DifferenceItems -> Difference, SymDifferenceItems -> SymmetricDifference, IntersectionItems -> Intersection, UnionItems -> Union

libstd/hash/{table, map}:
    Entries -> Iter, MoveItems -> IntoIter, MutEntries -> IterMut

Also a [breaking-change].
@1wilkens
Copy link
Contributor Author

Okay I renamed the missing DifferenceItems and marked Clone [stable] again.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 22, 2014
Conflicts:
	src/libcollections/bit.rs
	src/libcore/str.rs
@bors bors merged commit 22050e3 into rust-lang:master Dec 23, 2014
@1wilkens 1wilkens deleted the iter_rename branch January 8, 2015 09:57
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.

8 participants