clean tests/ui/if_let_redundant_pattern_matching.rs

Cleaning the empty lines for clarity.
This commit is contained in:
Luis de Bethencourt 2017-05-11 12:31:44 +01:00
parent 2389f9e94c
commit 3ca67910a8
2 changed files with 6 additions and 24 deletions

View File

@ -8,46 +8,28 @@
fn main() { fn main() {
if let Ok(_) = Ok::<i32, i32>(42) {} if let Ok(_) = Ok::<i32, i32>(42) {}
if let Err(_) = Err::<i32, i32>(42) { if let Err(_) = Err::<i32, i32>(42) {
} }
if let None = None::<()> { if let None = None::<()> {
} }
if let Some(_) = Some(42) { if let Some(_) = Some(42) {
} }
if Ok::<i32, i32>(42).is_ok() { if Ok::<i32, i32>(42).is_ok() {
} }
if Err::<i32, i32>(42).is_err() { if Err::<i32, i32>(42).is_err() {
} }
if None::<i32>.is_none() { if None::<i32>.is_none() {
} }
if Some(42).is_some() { if Some(42).is_some() {
} }
if let Ok(x) = Ok::<i32,i32>(42) { if let Ok(x) = Ok::<i32,i32>(42) {
println!("{}", x); println!("{}", x);
} }
} }

View File

@ -12,25 +12,25 @@ note: lint level defined here
| ^^^^^^ | ^^^^^^
error: redundant pattern matching, consider using `is_err()` error: redundant pattern matching, consider using `is_err()`
--> $DIR/if_let_redundant_pattern_matching.rs:14:12 --> $DIR/if_let_redundant_pattern_matching.rs:11:12
| |
14 | if let Err(_) = Err::<i32, i32>(42) { 11 | if let Err(_) = Err::<i32, i32>(42) {
| -------^^^^^^---------------------- help: try this `if Err::<i32, i32>(42).is_err()` | -------^^^^^^---------------------- help: try this `if Err::<i32, i32>(42).is_err()`
| |
= note: #[deny(if_let_redundant_pattern_matching)] implied by #[deny(clippy)] = note: #[deny(if_let_redundant_pattern_matching)] implied by #[deny(clippy)]
error: redundant pattern matching, consider using `is_none()` error: redundant pattern matching, consider using `is_none()`
--> $DIR/if_let_redundant_pattern_matching.rs:20:12 --> $DIR/if_let_redundant_pattern_matching.rs:14:12
| |
20 | if let None = None::<()> { 14 | if let None = None::<()> {
| -------^^^^------------- help: try this `if None::<()>.is_none()` | -------^^^^------------- help: try this `if None::<()>.is_none()`
| |
= note: #[deny(if_let_redundant_pattern_matching)] implied by #[deny(clippy)] = note: #[deny(if_let_redundant_pattern_matching)] implied by #[deny(clippy)]
error: redundant pattern matching, consider using `is_some()` error: redundant pattern matching, consider using `is_some()`
--> $DIR/if_let_redundant_pattern_matching.rs:26:12 --> $DIR/if_let_redundant_pattern_matching.rs:17:12
| |
26 | if let Some(_) = Some(42) { 17 | if let Some(_) = Some(42) {
| -------^^^^^^^----------- help: try this `if Some(42).is_some()` | -------^^^^^^^----------- help: try this `if Some(42).is_some()`
| |
= note: #[deny(if_let_redundant_pattern_matching)] implied by #[deny(clippy)] = note: #[deny(if_let_redundant_pattern_matching)] implied by #[deny(clippy)]