2023-07-27 12:04:01 -05:00
|
|
|
#![warn(clippy::ignored_unit_patterns)]
|
2023-09-02 16:06:16 -05:00
|
|
|
#![allow(clippy::let_unit_value, clippy::redundant_pattern_matching, clippy::single_match)]
|
2023-07-27 12:04:01 -05:00
|
|
|
|
|
|
|
fn foo() -> Result<(), ()> {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match foo() {
|
2023-09-04 10:04:04 -05:00
|
|
|
Ok(_) => {}, //~ ERROR: matching over `()` is more explicit
|
|
|
|
Err(_) => {}, //~ ERROR: matching over `()` is more explicit
|
2023-07-27 12:04:01 -05:00
|
|
|
}
|
|
|
|
if let Ok(_) = foo() {}
|
2023-09-04 10:04:04 -05:00
|
|
|
//~^ ERROR: matching over `()` is more explicit
|
2023-07-27 12:04:01 -05:00
|
|
|
let _ = foo().map_err(|_| todo!());
|
2023-09-04 10:04:04 -05:00
|
|
|
//~^ ERROR: matching over `()` is more explicit
|
2023-07-27 12:04:01 -05:00
|
|
|
}
|
2023-09-02 16:06:16 -05:00
|
|
|
|
|
|
|
#[allow(unused)]
|
|
|
|
pub fn moo(_: ()) {
|
|
|
|
let _ = foo().unwrap();
|
|
|
|
//~^ ERROR: matching over `()` is more explicit
|
|
|
|
let _: () = foo().unwrap();
|
|
|
|
let _: () = ();
|
|
|
|
}
|