2016-10-29 18:56:12 +02:00
|
|
|
|
2017-09-18 12:47:33 +02:00
|
|
|
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
#![warn(clippy)]
|
|
|
|
#![warn(if_let_redundant_pattern_matching)]
|
2016-10-29 18:56:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
if let Ok(_) = Ok::<i32, i32>(42) {}
|
2017-02-08 14:58:07 +01:00
|
|
|
|
2016-10-29 18:56:12 +02:00
|
|
|
if let Err(_) = Err::<i32, i32>(42) {
|
|
|
|
}
|
|
|
|
|
|
|
|
if let None = None::<()> {
|
|
|
|
}
|
|
|
|
|
|
|
|
if let Some(_) = Some(42) {
|
|
|
|
}
|
|
|
|
|
|
|
|
if Ok::<i32, i32>(42).is_ok() {
|
|
|
|
}
|
|
|
|
|
|
|
|
if Err::<i32, i32>(42).is_err() {
|
|
|
|
}
|
|
|
|
|
|
|
|
if None::<i32>.is_none() {
|
|
|
|
}
|
|
|
|
|
|
|
|
if Some(42).is_some() {
|
|
|
|
}
|
|
|
|
|
|
|
|
if let Ok(x) = Ok::<i32,i32>(42) {
|
|
|
|
println!("{}", x);
|
|
|
|
}
|
|
|
|
}
|