unnecessary_unwrap
does not consider non-nested control flow
#13805
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Summary
unnecessary_unwrap
lints when theunwrap()
is inside anif option.is_some()
orif option.is_none()
, but does not lint when the condition is an early return and theunwrap()
is in following rather than nested code.Lint Name
unnecessary_unwrap
Reproducer
I tried this code:
I expected to see this happen: Each of these functions should provoke a warning
Instead, this happened: No warnings on silent1 and silent2
Version
The text was updated successfully, but these errors were encountered: