Skip to content

Commit 13fdae1

Browse files
Address Lints in bevy_reflect (#18479)
# Objective On Windows there are several unaddressed lints raised by clippy. ## Solution Addressed them! ## Testing - CI on Windows & Ubuntu
1 parent 1ffa825 commit 13fdae1

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

crates/bevy_reflect/derive/src/container_attributes.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,11 @@ impl ContainerAttributes {
401401
// Override `lit` if this is a `FromReflect` derive.
402402
// This typically means a user is opting out of the default implementation
403403
// from the `Reflect` derive and using the `FromReflect` derive directly instead.
404-
(trait_ == ReflectTraitToImpl::FromReflect)
405-
.then(|| LitBool::new(true, Span::call_site()))
406-
.unwrap_or_else(|| lit.clone())
404+
if trait_ == ReflectTraitToImpl::FromReflect {
405+
LitBool::new(true, Span::call_site())
406+
} else {
407+
lit.clone()
408+
}
407409
})?;
408410

409411
if let Some(existing) = &self.from_reflect_attrs.auto_derive {
@@ -434,9 +436,11 @@ impl ContainerAttributes {
434436
// Override `lit` if this is a `FromReflect` derive.
435437
// This typically means a user is opting out of the default implementation
436438
// from the `Reflect` derive and using the `FromReflect` derive directly instead.
437-
(trait_ == ReflectTraitToImpl::TypePath)
438-
.then(|| LitBool::new(true, Span::call_site()))
439-
.unwrap_or_else(|| lit.clone())
439+
if trait_ == ReflectTraitToImpl::TypePath {
440+
LitBool::new(true, Span::call_site())
441+
} else {
442+
lit.clone()
443+
}
440444
})?;
441445

442446
if let Some(existing) = &self.type_path_attrs.auto_derive {

crates/bevy_reflect/derive/src/derive_data.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ pub(crate) enum ReflectTypePath<'a> {
11001100
reason = "Not currently used but may be useful in the future due to its generality."
11011101
)]
11021102
Anonymous {
1103-
qualified_type: Type,
1103+
qualified_type: Box<Type>,
11041104
long_type_path: StringExpr,
11051105
short_type_path: StringExpr,
11061106
},

0 commit comments

Comments
 (0)