unnecessary_wraps suggests to unwrap unit instead of omitting return value #6640
Labels
C-bug
Category: Clippy is not doing the correct thing
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
good-first-issue
These issues are a good way to get started with Clippy
L-suggestion
Lint: Improving, adding or fixing lint suggestions
I tried this code:
I expected that clippy suggests omitting return value at all:
Instead, it suggests returning unit:
and it's stupid because if you follow the instructions it shows another lint warning:
It should suggest omitting return value in the first place.
Tested on Rust playgound
Meta
cargo clippy -V
: e.g. clippy 0.1.51 (2021-01-19 c5a96fb)rustc 1.51.0-nightly
The text was updated successfully, but these errors were encountered: