mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
35 lines
517 B
Rust
35 lines
517 B
Rust
#![feature(tool_lints)]
|
|
|
|
|
|
#![warn(clippy::all)]
|
|
#![warn(clippy::if_let_redundant_pattern_matching)]
|
|
|
|
|
|
fn main() {
|
|
if let Ok(_) = Ok::<i32, i32>(42) {}
|
|
|
|
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);
|
|
}
|
|
}
|