rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

`let_underscore_drop` and ignoring error

Open uselessgoddess opened this issue 2 years ago • 0 comments

I ignore some errors with try block. I annotate type via let _: Result<...> = try { ... }. But clippy:

warning: non-binding `let` on a type that implements `Drop`
  --> some/path:
   |
   | /         let _: Result<_> = try {
   | |            . . .
   | |         };
   | |__________^
   |
   = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

How can I fix this

uselessgoddess avatar Aug 09 '22 17:08 uselessgoddess