-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Minor Iterator::filter_map description rewording. #43965
Conversation
r? @BurntSushi (rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ rollup |
📌 Commit e29c020 has been approved by |
@bors r- i thought about this again. consider this code: ["1", "foo", "3"]
.iter()
.filter_map(|n| n.parse::<i32>())
.collect() here's how you'd implement it with ["1", "foo", "3"]
.iter()
.filter(|n| n.parse::<i32>().is_some())
.map(|n| n.parse::<i32>().unwrap())
.collect() i can't think of a way to implement it with ["1", "foo", "3"]
.iter()
.map(|n| n.parse::<i32>())
.filter(|n| n.is_some())
.collect() // [Some(1), Some(3)] so i think you're idea to do " |
The linked issue says it in terms of |
e29c020
to
aac3008
Compare
agreed with everything you said;switched to "map with filter" @bors r=QuietMisdreavus |
📌 Commit aac3008 has been approved by |
⌛ Testing commit aac3008 with merge 77213e740777020ee48e0d5f40ac033df2e908bb... |
💔 Test failed - status-appveyor |
Minor Iterator::filter_map description rewording. Fixes #39294.
☀️ Test successful - status-appveyor, status-travis |
Fixes #39294.