File tree Expand file tree Collapse file tree 6 files changed +22
-11
lines changed Expand file tree Collapse file tree 6 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,12 @@ use std::collections::HashMap;
12
12
pub ( crate ) fn generate_class_struct ( class : & GodotClass ) -> TokenStream {
13
13
let class_name = format_ident ! ( "{}" , & class. name) ;
14
14
15
+ // dead_code: 'this' might not be read
15
16
quote ! {
16
17
#[ allow( non_camel_case_types) ]
17
18
#[ derive( Debug ) ]
18
19
pub struct #class_name {
20
+ #[ allow( dead_code) ]
19
21
this: RawObject <Self >,
20
22
}
21
23
}
Original file line number Diff line number Diff line change @@ -625,9 +625,11 @@ godot_test!(test_dictionary {
625
625
let expected_keys = [ "foo" , "bar" ] . iter( ) . map( |& s| s. to_string( ) ) . collect:: <HashSet <_>>( ) ;
626
626
for ( key, value) in & dict {
627
627
assert_eq!( Some ( value) , dict. get( & key) ) ;
628
- if !iter_keys. insert( key. to_string( ) ) {
629
- panic!( "key is already contained in set: {:?}" , key) ;
630
- }
628
+ assert!(
629
+ iter_keys. insert( key. to_string( ) ) ,
630
+ "key is already contained in set: {:?}" ,
631
+ key
632
+ ) ;
631
633
}
632
634
assert_eq!( expected_keys, iter_keys) ;
633
635
} ) ;
Original file line number Diff line number Diff line change 20
20
//! [thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html
21
21
22
22
#![ deny( clippy:: missing_inline_in_public_items) ]
23
- #![ allow( clippy:: transmute_ptr_to_ptr) ]
23
+ #![ allow(
24
+ clippy:: transmute_ptr_to_ptr,
25
+ clippy:: missing_safety_doc,
26
+ clippy:: if_then_panic
27
+ ) ]
24
28
#![ cfg_attr( feature = "gd_test" , allow( clippy:: blacklisted_name) ) ]
25
29
26
30
#[ doc( hidden) ]
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ unsafe fn check_api_compatibility(
79
79
/// not bound will lead to an abort**, since in most cases there is simply no point to continue
80
80
/// if `get_api` failed. This allows it to be used in FFI contexts without a `catch_unwind`.
81
81
#[ inline]
82
+ #[ allow( clippy:: redundant_closure) ] // clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7812
82
83
pub fn get_api ( ) -> & ' static sys:: GodotApi {
83
84
unsafe { GODOT_API . as_ref ( ) . unwrap_or_else ( || std:: process:: abort ( ) ) }
84
85
}
Original file line number Diff line number Diff line change @@ -64,9 +64,10 @@ mod header_binding {
64
64
// and have been erroneously used for target platforms in this library in the past. Make sure
65
65
// to double-check them wherever they occur.
66
66
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
+ ) ;
70
71
71
72
builder = builder
72
73
. clang_arg ( "-I" )
@@ -457,9 +458,10 @@ mod api_wrapper {
457
458
458
459
for api in api_root. all_apis ( ) {
459
460
// 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
+ ) ;
463
465
}
464
466
465
467
let struct_fields = godot_api_functions ( & api_root) ;
Original file line number Diff line number Diff line change 1
- #![ allow( clippy:: blacklisted_name) ]
1
+ #![ allow( clippy:: blacklisted_name, clippy :: if_then_panic ) ]
2
2
3
3
use gdnative:: prelude:: * ;
4
4
You can’t perform that action at this time.
0 commit comments