diff --git a/azalea-ecs/azalea-ecs-macros/src/component.rs b/azalea-ecs/azalea-ecs-macros/src/component.rs index 015c31be..306b64de 100644 --- a/azalea-ecs/azalea-ecs-macros/src/component.rs +++ b/azalea-ecs/azalea-ecs-macros/src/component.rs @@ -88,8 +88,7 @@ fn parse_component_attr(ast: &DeriveInput) -> Result { return Err(Error::new_spanned( m.lit, format!( - "Invalid storage type `{}`, expected '{}' or '{}'.", - s, TABLE, SPARSE_SET + "Invalid storage type `{s}`, expected '{TABLE}' or '{SPARSE_SET}'." ), )) } diff --git a/azalea-ecs/azalea-ecs-macros/src/fetch.rs b/azalea-ecs/azalea-ecs-macros/src/fetch.rs index 57ffef38..8a6b93ba 100644 --- a/azalea-ecs/azalea-ecs-macros/src/fetch.rs +++ b/azalea-ecs/azalea-ecs-macros/src/fetch.rs @@ -52,8 +52,7 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream { fetch_struct_attributes.is_mutable = true; } else { panic!( - "The `{}` attribute is expected to have no value or arguments", - MUTABLE_ATTRIBUTE_NAME + "The `{MUTABLE_ATTRIBUTE_NAME}` attribute is expected to have no value or arguments" ); } } else if ident == DERIVE_ATTRIBUTE_NAME { @@ -63,8 +62,7 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream { .extend(meta_list.nested.iter().cloned()); } else { panic!( - "Expected a structured list within the `{}` attribute", - DERIVE_ATTRIBUTE_NAME + "Expected a structured list within the `{DERIVE_ATTRIBUTE_NAME}` attribute" ); } } else { diff --git a/azalea-ecs/azalea-ecs-macros/src/utils/attrs.rs b/azalea-ecs/azalea-ecs-macros/src/utils/attrs.rs index 6863d79e..caf2d44e 100644 --- a/azalea-ecs/azalea-ecs-macros/src/utils/attrs.rs +++ b/azalea-ecs/azalea-ecs-macros/src/utils/attrs.rs @@ -27,8 +27,7 @@ pub fn get_lit_str(attr_name: Symbol, lit: &syn::Lit) -> syn::Result<&syn::LitSt Err(syn::Error::new_spanned( lit, format!( - "expected {} attribute to be a string: `{} = \"...\"`", - attr_name, attr_name + "expected {attr_name} attribute to be a string: `{attr_name} = \"...\"`" ), )) } @@ -41,8 +40,7 @@ pub fn get_lit_bool(attr_name: Symbol, lit: &syn::Lit) -> syn::Result { Err(syn::Error::new_spanned( lit, format!( - "expected {} attribute to be a bool value, `true` or `false`: `{} = ...`", - attr_name, attr_name + "expected {attr_name} attribute to be a bool value, `true` or `false`: `{attr_name} = ...`" ), )) } diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index a62412d2..9dd302cb 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -354,13 +354,13 @@ mod tests { )) .id(); { - let entity_pos = app.world.get::(entity).unwrap().clone(); + let entity_pos = *app.world.get::(entity).unwrap(); // y should start at 70 assert_eq!(entity_pos.y, 70.); } app.update(); { - let entity_pos = app.world.get::(entity).unwrap().clone(); + let entity_pos = *app.world.get::(entity).unwrap(); // delta is applied before gravity, so the first tick only sets the delta assert_eq!(entity_pos.y, 70.); let entity_physics = app.world.get::(entity).unwrap().clone(); @@ -368,7 +368,7 @@ mod tests { } app.update(); { - let entity_pos = app.world.get::(entity).unwrap().clone(); + let entity_pos = *app.world.get::(entity).unwrap(); // the second tick applies the delta to the position, so now it should go down assert!( entity_pos.y < 70., @@ -420,7 +420,7 @@ mod tests { ); app.update(); { - let entity_pos = app.world.get::(entity).unwrap().clone(); + let entity_pos = *app.world.get::(entity).unwrap(); // delta will change, but it won't move until next tick assert_eq!(entity_pos.y, 70.); let entity_physics = app.world.get::(entity).unwrap().clone(); @@ -428,7 +428,7 @@ mod tests { } app.update(); { - let entity_pos = app.world.get::(entity).unwrap().clone(); + let entity_pos = *app.world.get::(entity).unwrap(); // the second tick applies the delta to the position, but it also does collision assert_eq!(entity_pos.y, 70.); }