Skip to content

book: Explain better why the filter closure gets a reference #31870

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

Merged
merged 1 commit into from
Feb 25, 2016
Merged

book: Explain better why the filter closure gets a reference #31870

merged 1 commit into from
Feb 25, 2016

Conversation

ivan
Copy link
Contributor

@ivan ivan commented Feb 24, 2016

As a Rust newbie, I found the book's explanation for why the filter closure gets a reference very confusing, and tried to figure out why filter is somehow less consumptive than map -- but it isn't; that's controlled by iter/into_iter. I flailed around for a while until @habnabit explained it to me, and in retrospect it is quite obvious :-)

@steveklabnik
Copy link
Member

@bors: r+ rollup

thank you!

@bors
Copy link
Collaborator

bors commented Feb 24, 2016

📌 Commit 7042c8e has been approved by steveklabnik

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 24, 2016
As a Rust newbie, I found the book's explanation for why the `filter` closure gets a reference very confusing, and tried to figure out why `filter` is somehow less consumptive than `map` -- but it isn't; that's controlled by `iter`/`into_iter`.  I flailed around for a while until @habnabit explained it to me, and in retrospect it is quite obvious :-)
bors added a commit that referenced this pull request Feb 24, 2016
@bors bors merged commit 7042c8e into rust-lang:master Feb 25, 2016
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.

3 participants