Found explicitly ignored unit valueRS-W1129
The () type, also called “unit”, has exactly one value (), and is used when there is no other meaningful value that could be returned. It is most commonly seen implicitly: functions without a -> implicitly have return type (), that is, these are equivalent:
fn foo() {}
// vs,
fn foo() -> () {}
Hence explicitly ignoring values of unit type is redundant.
Bad practice
fn foo() {}
fn main() {
let _ = (); // bad
let _ = foo(); // bad
}
Recommended
fn foo() {}
fn main() {
(); // fine
foo(); // fine
}