rust/tests/ui/if_let_redundant_pattern_matching.rs

54 lines
536 B
Rust
Raw Normal View History

#![feature(plugin)]
#![plugin(clippy)]
#![deny(clippy)]
#![deny(if_let_redundant_pattern_matching)]
fn main() {
if let Ok(_) = Ok::<i32, i32>(42) {}
2017-02-08 14:58:07 +01:00
if let Err(_) = Err::<i32, i32>(42) {
2017-02-08 14:58:07 +01:00
}
if let None = None::<()> {
2017-02-08 14:58:07 +01:00
}
if let Some(_) = Some(42) {
2017-02-08 14:58:07 +01:00
}
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);
}
}