iter_skip_zero
denies code where Skip<T>
is required in the type
#11761
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 writing some branching code that returns a value on each branch and their types must match. In some branches I call
.skip(n)
with a non-zeron
, so I must call.skip(0)
in the other branches so the type matches up. Clippy currently denies this code by default even though it is correct.This has also been brought up in the PR that introduced this lint, but no issue has been made yet: #11046 (comment)
Lint Name
iter_skip_zero
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
Clippy should recognize that
skip(n)
changes an iterator's type and may be required.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: