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
This commit is contained in:
Zachary Harrold 2025-03-24 10:53:31 +11:00 committed by François Mockers
parent 75ad8bda40
commit ff189cf4ef
2 changed files with 11 additions and 7 deletions

View File

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

View File

@ -1100,7 +1100,7 @@ pub(crate) enum ReflectTypePath<'a> {
reason = "Not currently used but may be useful in the future due to its generality."
)]
Anonymous {
qualified_type: Type,
qualified_type: Box<Type>,
long_type_path: StringExpr,
short_type_path: StringExpr,
},