Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

Commit da7ba16

Browse files
haraldhnpmccallum
authored andcommitted
fix: clippy: only a panic! in if-then statement
https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic Signed-off-by: Harald Hoyer <[email protected]>
1 parent ff63f18 commit da7ba16

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

build.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ fn build_rs_tests(in_path: &Path, out_path: &Path) {
7777
.status()
7878
.unwrap_or_else(|_| panic!("failed to compile {:#?}", &in_source));
7979

80-
if !status.success() {
81-
panic!("Failed to compile {:?}", &in_source);
82-
}
80+
assert!(status.success(), "Failed to compile {:?}", &in_source);
8381
}
8482
}
8583

@@ -105,9 +103,7 @@ fn build_cc_tests(in_path: &Path, out_path: &Path) {
105103
.status()
106104
.unwrap_or_else(|_| panic!("failed to compile {:#?}", &in_source));
107105

108-
if !status.success() {
109-
panic!("Failed to compile {:?}", &in_source);
110-
}
106+
assert!(status.success(), "Failed to compile {:?}", &in_source);
111107
}
112108
}
113109

0 commit comments

Comments
 (0)