Closed
Description
fn main() {
let _: () = f();
}
fn f<T: Default>() -> T {
T::default()
}
warning: this let-binding has unit value. Consider omitting `let _ =`, #[warn(let_unit_value)] on by default
--> src/main.rs:2:5
|
2 | let _: () = f();
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#let_unit_value
Maybe this specific case would be clearer with f::<()>()
but I consider this a false positive. Came up in serde_json unit tests where we test that serde_json::from_str can parse various representations of ().