struct with accessor to a Peekable field can cause unused_peekable to trigger #9480
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
I'm not sure whether this count as FP, so I'm reporting just in case. If it doesn't, feel free to close the issue
A struct containing a
Peekable
, and giving an accessor to it causesunused_peekable
to be raised if the consumer of the accessor only use it as an iterator, without peeking.I think this lint should only trigger following a call to
.peekable()
Lint Name
unused_peekable
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
no warn
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: