mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 01:17:16 +00:00
25 lines
711 B
Rust
25 lines
711 B
Rust
#![warn(clippy::ignored_unit_patterns)]
|
|
#![allow(clippy::let_unit_value, clippy::redundant_pattern_matching, clippy::single_match)]
|
|
|
|
fn foo() -> Result<(), ()> {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn main() {
|
|
match foo() {
|
|
Ok(()) => {}, //~ ERROR: matching over `()` is more explicit
|
|
Err(()) => {}, //~ ERROR: matching over `()` is more explicit
|
|
}
|
|
if let Ok(()) = foo() {}
|
|
//~^ ERROR: matching over `()` is more explicit
|
|
let _ = foo().map_err(|()| todo!());
|
|
//~^ ERROR: matching over `()` is more explicit
|
|
}
|
|
|
|
#[allow(unused)]
|
|
pub fn moo(_: ()) {
|
|
let () = foo().unwrap();
|
|
//~^ ERROR: matching over `()` is more explicit
|
|
let _: () = foo().unwrap();
|
|
let _: () = ();
|
|
}
|