Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
ivan:filter-explain
Feb 25, 2016
Merged

bors merged 1 commit into
rust-lang:masterfrom
ivan:filter-explain

Conversation

@ivan

@ivan ivan commented Feb 24, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@bors: r+ rollup

thank you!

@bors

bors commented Feb 24, 2016

Copy link
Copy Markdown
Collaborator

📌 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