Skip to content

Commit

Permalink
Fix typo (#300)
Browse files Browse the repository at this point in the history
`Iterator::filter_map` is analogous to `Iterator::map`, not `Iterator::flat_map`
  • Loading branch information
andrewsonin committed Mar 9, 2022
1 parent d510bc2 commit 482c2b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion idioms/option-iter.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ iterator which yields exactly one element. It's a more readable alternative to
`Some(foo).into_iter()`.

* [`Iterator::filter_map`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.filter_map)
is a version of [`Iterator::flat_map`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.flat_map),
is a version of [`Iterator::map`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.map),
specialized to mapping functions which return `Option`.

* The [`ref_slice`](https://crates.io/crates/ref_slice) crate provides functions
Expand Down

0 comments on commit 482c2b8

Please sign in to comment.