Incorrect report of needless collect with the sequence from_fn().collect() follow by vec.into_iter().rev().collect() #8132
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
Summary
The iterator in front of the first
collect
is not bi-directional. clippy fail at identify that the subsequentrev()
would not accept it if the operation were chained as suggested.Lint Name
needless_collect
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
Version
No response
Additional Labels
l-suggestion-causes-error
The text was updated successfully, but these errors were encountered: