filter_map
suggestion on flat_map
is wrong
#7050
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Lint name: filter_map
I tried this code:
I expected to see this happen: no warning
Instead, this happened:
This warning is special case of
filter_map
forflat_map
that should be completely removed.This suggestion is incorrect and can never work. The
flat_map
function must return a single type of iterator. It can't conditionally returniter::empty()
. That won't compile.Playground
The text was updated successfully, but these errors were encountered: