Skip to content

Commit d1e2895

Browse files
author
toasteater
committed
Fix clippy lints
1 parent e77f82b commit d1e2895

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

bindings_generator/src/api.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ impl GodotClass {
137137

138138
pub fn is_singleton_thread_safe(&self) -> bool {
139139
assert!(self.singleton, "class is not a singleton");
140-
match self.name.as_str() {
141-
"VisualServer" | "PhysicsServer" | "Physics3DServer" | "Physics2DServer" => false,
142-
_ => true,
143-
}
140+
!matches!(
141+
self.name.as_str(),
142+
"VisualServer" | "PhysicsServer" | "Physics3DServer" | "Physics2DServer"
143+
)
144144
}
145145

146146
/// Returns the base class from `api` if `base_class` is not empty. Returns `None` otherwise.

gdnative-derive/src/methods.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,7 @@ fn impl_gdnative_expose(ast: ItemImpl) -> (ItemImpl, ClassMethodExport) {
209209

210210
// only allow the "outer" style, aka #[thing] item.
211211
method.attrs.retain(|attr| {
212-
let correct_style = match attr.style {
213-
syn::AttrStyle::Outer => true,
214-
_ => false,
215-
};
216-
217-
if correct_style {
212+
if matches!(attr.style, syn::AttrStyle::Outer) {
218213
let last_seg = attr
219214
.path
220215
.segments

0 commit comments

Comments
 (0)