Skip to content

Commit 15791bd

Browse files
committed
Clippy lints in nightly
Error: only a `panic!` in `if`-then statement Suggestion -- replace: if (cond) { panic!(msg) } with: assert!(!cond, msg);
1 parent 72f645d commit 15791bd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

gdnative-sys/build.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ mod header_binding {
6464
// and have been erroneously used for target platforms in this library in the past. Make sure
6565
// to double-check them wherever they occur.
6666

67-
if !cfg!(target_arch = "x86_64") {
68-
panic!("unsupported host architecture: build from x86_64 instead");
69-
}
67+
assert!(
68+
cfg!(target_arch = "x86_64"),
69+
"unsupported host architecture: build from x86_64 instead"
70+
);
7071

7172
builder = builder
7273
.clang_arg("-I")
@@ -457,9 +458,10 @@ mod api_wrapper {
457458

458459
for api in api_root.all_apis() {
459460
// Currently don't support Godot 4.0
460-
if api.version.major == 1 && api.version.minor == 3 {
461-
panic!("GodotEngine v4.* is not yet supported. See https://github.com/godot-rust/godot-rust/issues/396");
462-
}
461+
assert!(
462+
!(api.version.major == 1 && api.version.minor == 3),
463+
"GodotEngine v4.* is not yet supported. See https://github.com/godot-rust/godot-rust/issues/396"
464+
);
463465
}
464466

465467
let struct_fields = godot_api_functions(&api_root);

0 commit comments

Comments
 (0)