File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -231,8 +231,12 @@ declare_clippy_lint! {
231
231
/// used instead.
232
232
///
233
233
/// ### Why is this bad?
234
- /// When applicable, `filter_map()` is more clear since it shows that
235
- /// `Option` is used to produce 0 or 1 items.
234
+ /// `filter_map()` is known to always produce 0 or 1 output items per input item,
235
+ /// rather than however many the inner iterator type produces.
236
+ /// Therefore, it maintains the upper bound in `Iterator::size_hint()`,
237
+ /// and communicates to the reader that the input items are not being expanded into
238
+ /// multiple output items without their having to notice that the mapping function
239
+ /// returns an `Option`.
236
240
///
237
241
/// ### Example
238
242
/// ```no_run
You can’t perform that action at this time.
0 commit comments