Skip to content

Commit 9298387

Browse files
committed
Address clippy::nursery lint errors in macros.
1 parent a03ecc5 commit 9298387

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

godot-ffi/src/plugins.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,15 @@ macro_rules! plugin_execute_pre_main {
5959
};
6060
}
6161

62-
/// Register a plugin by executing code pre-main that adds the plugin to the registry.
63-
#[doc(hidden)]
64-
#[macro_export]
65-
macro_rules! plugin_add_inner {
66-
($registry:path; $plugin:expr) => {
67-
$crate::plugin_execute_pre_main!({
68-
let mut guard = $registry.lock().unwrap();
69-
70-
guard.push($plugin);
71-
});
72-
};
73-
}
74-
7562
/// Register a plugin to a registry.
7663
#[doc(hidden)]
7764
#[macro_export]
7865
macro_rules! plugin_add {
7966
( $registry:path; $plugin:expr ) => {
80-
$crate::plugin_add_inner!($registry; $plugin);
81-
};
67+
$crate::plugin_execute_pre_main!({
68+
$registry.lock().unwrap().push($plugin);
69+
});
70+
};
8271
}
8372

8473
#[doc(hidden)]

godot-macros/src/class/derive_godot_class.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ fn make_oneditor_panic_inits(class_name: &Ident, all_fields: &[Field]) -> TokenS
393393

394394
if !on_editor_fields_checks.is_empty() {
395395
quote! {
396+
// Triggers `clippy::useless_let_if_seq` lint if only one `#on_editor_fields_checks` is present.
397+
#[allow(clippy::useless_let_if_seq)]
396398
fn __are_oneditor_fields_initalized(this: &#class_name) -> bool {
397399
// Early return for `#[class(tool)]`.
398400
if #is_in_editor {

0 commit comments

Comments
 (0)