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

Move most iter functionality to extra, fixes #7343 #7474

Closed
wants to merge 2 commits into from

Conversation

Seldaek
Copy link
Contributor

@Seldaek Seldaek commented Jun 29, 2013

I think it's WIP - but I wanted to ask for feedback (/cc @thestinger)

I had to move the impl of FromIter for vec into extra::iter because I don't think std can depend on extra, but that's a bit messed up. Similarly some FromIter uses are gone now, not sure if this is fixable or if I made a complete mess here..

@thestinger
Copy link
Contributor

@Seldaek: this looks good, removing FromIter to libextra is fine

just needs to be rebased and I guess some use statements need to be updated

@Seldaek
Copy link
Contributor Author

Seldaek commented Jun 30, 2013

Rebased, seems to compile fine. I'm still unsure whether leaving core::iter::Times there is a good idea or not. It feels messy to have core::iter and extra::iter, but if it's transitional then I guess it's fine. Just trying to help close an issue but I don't have enough of a big picture to tell.

@Seldaek
Copy link
Contributor Author

Seldaek commented Jun 30, 2013

Scratch my last comment, it does not compile at all - there are indeed a bunch of places using std::iter still, and I frankly don't know what to do about some of them but I'll keep looking.

@Seldaek
Copy link
Contributor Author

Seldaek commented Jun 30, 2013

OK I had to implement an EnumSetIterator to be able to keep things working reasonably, and now I think it's good. Last I checked everything builds and the test suite passes.

}

fn size_hint(&self) -> (Option<uint>, Option<uint>) {
let exact = Some(self.orig_bits.population_count());
Copy link
Contributor

Choose a reason for hiding this comment

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

The size_hint represents the number of elements remaining, so you probably want to use self.bits here (I think).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I misunderstood that, the orig_bits property can completely disappear then. I updated the PR.

bors added a commit that referenced this pull request Jul 3, 2013
I think it's WIP - but I wanted to ask for feedback (/cc @thestinger)

I had to move the impl of FromIter for vec into extra::iter because I don't think std can depend on extra, but that's a bit messed up. Similarly some FromIter uses are gone now, not sure if this is fixable or if I made a complete mess here..
@bors bors closed this Jul 3, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 19, 2021
Use lang items for BinOp lints

changelog: none
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.

4 participants