From fbc300608c2a27d8b42f12ba35cdcc0bd91b4ac3 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 17 Jul 2022 21:31:38 +0900 Subject: [PATCH] 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 ``` --- tests/std.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/std.rs b/tests/std.rs index 9439476..26112c8 100644 --- a/tests/std.rs +++ b/tests/std.rs @@ -23,10 +23,9 @@ fn smoke() { #[test] fn smoke_failure() { - match Command::new("if-this-is-a-binary-then-the-world-has-ended").spawn() { - Ok(..) => panic!(), - Err(..) => {} - } + assert!(Command::new("if-this-is-a-binary-then-the-world-has-ended") + .spawn() + .is_err()); } #[test]