-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
A-lintArea: New lintsArea: New lintsL-styleLint: Belongs in the style lint groupLint: Belongs in the style lint groupS-needs-discussionStatus: Needs further discussion before merging or work can be startedStatus: Needs further discussion before merging or work can be started
Description
What it does
I just found the following code:
drop(env_logger::try_init());Basically someone got a warning on an unused must_use type (in this case a Result), and thus "used" it … by dropping it. Tada, the warning's gone 🎉.
Categories (optional)
- Kind:
clippy::correctness
Drawbacks
None.
Example
drop(crate::try_do_stuff());Could be written as:
crate::try_do_stuff().unwrap();If the drop was intentional, it should be:
drop(crate::try_do_stuff().unwrap());Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsL-styleLint: Belongs in the style lint groupLint: Belongs in the style lint groupS-needs-discussionStatus: Needs further discussion before merging or work can be startedStatus: Needs further discussion before merging or work can be started