Open
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());