From 50eb2f62e3356ec10c9a1e1be7119cfdcd8ba619 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Thu, 30 Sep 2021 10:19:05 -0400 Subject: [PATCH] Fix clippy complaints in build.rs Clippy doesn't like `if !thing.ok() { panic!(msg) }`. Clippy prefers `assert!(thing_ok(), msg)`. Ok, clippy. Signed-off-by: Will Woods --- build.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/build.rs b/build.rs index bd756d5db..6799040c1 100644 --- a/build.rs +++ b/build.rs @@ -77,9 +77,7 @@ fn build_rs_tests(in_path: &Path, out_path: &Path) { .status() .unwrap_or_else(|_| panic!("failed to compile {:#?}", &in_source)); - if !status.success() { - panic!("Failed to compile {:?}", &in_source); - } + assert!(status.success(), "Failed to compile {:?}", &in_source); } } @@ -105,9 +103,7 @@ fn build_cc_tests(in_path: &Path, out_path: &Path) { .status() .unwrap_or_else(|_| panic!("failed to compile {:#?}", &in_source)); - if !status.success() { - panic!("Failed to compile {:?}", &in_source); - } + assert!(status.success(), "Failed to compile {:?}", &in_source); } }