rust-clippy/tests/ui/ignored_unit_patterns.fixed

16 lines
315 B
Rust
Raw Normal View History

2023-07-27 17:04:01 +00:00
#![warn(clippy::ignored_unit_patterns)]
#![allow(clippy::redundant_pattern_matching, clippy::single_match)]
fn foo() -> Result<(), ()> {
unimplemented!()
}
fn main() {
match foo() {
Ok(()) => {},
Err(()) => {},
}
if let Ok(()) = foo() {}
let _ = foo().map_err(|()| todo!());
}