Closed
Description
Summary
Sometimes I write code like this: let () = some_function_call()
. I do this to make sure that this function returns unit value, i. e. to make sure that I didn't miss any return value. But let_unit_value warns on this code. So, please, make it not to warn on this code
Lint Name
let_unit_value
Reproducer
I tried this code:
fn main() {
let mut v = vec![2, 1];
let () = v.sort();
}
I saw this happen:
Checking playground v0.0.1 (/playground)
warning: this let-binding has unit value
--> src/main.rs:3:5
|
3 | let () = v.sort();
| ^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `v.sort();`
|
= note: `#[warn(clippy::let_unit_value)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
warning: `playground` (bin "playground") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 0.42s
I expected to see this happen:
(no warn)
Version
Version from https://play.rust-lang.org/ as on today (2022-06-25)
Additional Labels
No response