Fix clippy::single_match warning in test

```
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
  --> tests/std.rs:26:5
   |
26 | /     match Command::new("if-this-is-a-binary-then-the-world-has-ended").spawn() {
27 | |         Ok(..) => panic!(),
28 | |         Err(..) => {}
29 | |     }
   | |_____^ help: try this: `if let Ok(..) = Command::new("if-this-is-a-binary-then-the-world-has-ended").spawn() { panic!() }`
   |
   = note: `#[warn(clippy::single_match)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
```
This commit is contained in:
Taiki Endo 2022-07-17 21:31:38 +09:00
parent bffd4efe40
commit fbc300608c
1 changed files with 3 additions and 4 deletions

View File

@ -23,10 +23,9 @@ fn smoke() {
#[test] #[test]
fn smoke_failure() { fn smoke_failure() {
match Command::new("if-this-is-a-binary-then-the-world-has-ended").spawn() { assert!(Command::new("if-this-is-a-binary-then-the-world-has-ended")
Ok(..) => panic!(), .spawn()
Err(..) => {} .is_err());
}
} }
#[test] #[test]