diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index d55cdca7eb..2a47aabb96 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -872,8 +872,7 @@ impl App { match self.add_boxed_plugin(Box::new(plugin)) { Ok(app) => app, Err(AppError::DuplicatePlugin { plugin_name }) => panic!( - "Error adding plugin {}: : plugin was already added in application", - plugin_name + "Error adding plugin {plugin_name}: : plugin was already added in application" ), } } diff --git a/crates/bevy_asset/src/reflect.rs b/crates/bevy_asset/src/reflect.rs index 81b22b5603..3d01ac148d 100644 --- a/crates/bevy_asset/src/reflect.rs +++ b/crates/bevy_asset/src/reflect.rs @@ -94,13 +94,13 @@ impl ReflectAsset { } /// Equivalent of [`Assets::add`] - pub fn add<'w>(&self, world: &'w mut World, value: &dyn Reflect) -> HandleUntyped { + pub fn add(&self, world: &mut World, value: &dyn Reflect) -> HandleUntyped { (self.add)(world, value) } /// Equivalent of [`Assets::set`] - pub fn set<'w>( + pub fn set( &self, - world: &'w mut World, + world: &mut World, handle: HandleUntyped, value: &dyn Reflect, ) -> HandleUntyped { diff --git a/crates/bevy_ecs/macros/src/component.rs b/crates/bevy_ecs/macros/src/component.rs index a75c4a92b3..b051e630eb 100644 --- a/crates/bevy_ecs/macros/src/component.rs +++ b/crates/bevy_ecs/macros/src/component.rs @@ -86,8 +86,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/crates/bevy_ecs/macros/src/fetch.rs b/crates/bevy_ecs/macros/src/fetch.rs index f4bd82b61a..418c5741e7 100644 --- a/crates/bevy_ecs/macros/src/fetch.rs +++ b/crates/bevy_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/crates/bevy_ecs/src/bundle.rs b/crates/bevy_ecs/src/bundle.rs index 259de1abed..042138a3c0 100644 --- a/crates/bevy_ecs/src/bundle.rs +++ b/crates/bevy_ecs/src/bundle.rs @@ -731,8 +731,7 @@ unsafe fn initialize_bundle( deduped.dedup(); assert!( deduped.len() == component_ids.len(), - "Bundle {} has duplicate components", - bundle_type_name + "Bundle {bundle_type_name} has duplicate components", ); BundleInfo { id, component_ids } diff --git a/crates/bevy_ecs/src/schedule/mod.rs b/crates/bevy_ecs/src/schedule/mod.rs index 7e9cf6e909..bc78e8f079 100644 --- a/crates/bevy_ecs/src/schedule/mod.rs +++ b/crates/bevy_ecs/src/schedule/mod.rs @@ -224,10 +224,7 @@ impl Schedule { // of the game. Closures inherit generic parameters from their enclosing function. #[cold] fn stage_not_found(stage_label: &dyn Debug) -> ! { - panic!( - "Stage '{:?}' does not exist or is not a SystemStage", - stage_label - ) + panic!("Stage '{stage_label:?}' does not exist or is not a SystemStage",) } let label = stage_label.as_label(); diff --git a/crates/bevy_ecs/src/schedule/stage.rs b/crates/bevy_ecs/src/schedule/stage.rs index d7386d2e59..05846c630b 100644 --- a/crates/bevy_ecs/src/schedule/stage.rs +++ b/crates/bevy_ecs/src/schedule/stage.rs @@ -287,10 +287,9 @@ impl SystemStage { .then(|| descriptor.system.name()) { panic!( - "The system {} has a run criteria, but its `SystemSet` also has a run \ + "The system {name} has a run criteria, but its `SystemSet` also has a run \ criteria. This is not supported. Consider moving the system into a \ - different `SystemSet` or calling `add_system()` instead.", - name + different `SystemSet` or calling `add_system()` instead." ) } } @@ -459,8 +458,7 @@ impl SystemStage { writeln!(message, " - {}", nodes[*index].name()).unwrap(); writeln!( message, - " wants to be after (because of labels: {:?})", - labels, + " wants to be after (because of labels: {labels:?})", ) .unwrap(); } @@ -565,10 +563,7 @@ impl SystemStage { if let RunCriteriaInner::Piped { input: parent, .. } = &mut criteria.inner { let label = &criteria.after[0]; *parent = *labels.get(label).unwrap_or_else(|| { - panic!( - "Couldn't find run criteria labelled {:?} to pipe from.", - label - ) + panic!("Couldn't find run criteria labelled {label:?} to pipe from.",) }); } } diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index 9f1c46a2e7..ed2d469b9b 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -282,8 +282,7 @@ impl<'w, 's> Commands<'w, 's> { pub fn entity<'a>(&'a mut self, entity: Entity) -> EntityCommands<'w, 's, 'a> { self.get_entity(entity).unwrap_or_else(|| { panic!( - "Attempting to create an EntityCommands for entity {:?}, which doesn't exist.", - entity + "Attempting to create an EntityCommands for entity {entity:?}, which doesn't exist.", ) }) } diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index a229925eca..c6dc2edf10 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -250,8 +250,7 @@ fn assert_component_access_compatibility( .map(|component_id| world.components.get_info(component_id).unwrap().name()) .collect::>(); let accesses = conflicting_components.join(", "); - panic!("error[B0001]: Query<{}, {}> in system {} accesses component(s) {} in a way that conflicts with a previous system parameter. Consider using `Without` to create disjoint Queries or merging conflicting Queries into a `ParamSet`.", - query_type, filter_type, system_name, accesses); + panic!("error[B0001]: Query<{query_type}, {filter_type}> in system {system_name} accesses component(s) {accesses} in a way that conflicts with a previous system parameter. Consider using `Without` to create disjoint Queries or merging conflicting Queries into a `ParamSet`."); } /// A collection of potentially conflicting [`SystemParam`]s allowed by disjoint access. diff --git a/crates/bevy_input/src/gamepad.rs b/crates/bevy_input/src/gamepad.rs index d0f17aa53d..e0c223769d 100644 --- a/crates/bevy_input/src/gamepad.rs +++ b/crates/bevy_input/src/gamepad.rs @@ -1256,8 +1256,7 @@ mod tests { let actual = settings.filter(new_value, old_value); assert_eq!( expected, actual, - "Testing filtering for {:?} with new_value = {:?}, old_value = {:?}", - settings, new_value, old_value + "Testing filtering for {settings:?} with new_value = {new_value:?}, old_value = {old_value:?}", ); } @@ -1312,8 +1311,7 @@ mod tests { let actual = settings.filter(new_value, old_value); assert_eq!( expected, actual, - "Testing filtering for {:?} with new_value = {:?}, old_value = {:?}", - settings, new_value, old_value + "Testing filtering for {settings:?} with new_value = {new_value:?}, old_value = {old_value:?}", ); } @@ -1398,8 +1396,7 @@ mod tests { assert_eq!( expected, actual, - "testing ButtonSettings::is_pressed() for value: {}", - value + "testing ButtonSettings::is_pressed() for value: {value}", ); } } @@ -1424,8 +1421,7 @@ mod tests { assert_eq!( expected, actual, - "testing ButtonSettings::is_released() for value: {}", - value + "testing ButtonSettings::is_released() for value: {value}", ); } } @@ -1450,8 +1446,7 @@ mod tests { } Err(_) => { panic!( - "ButtonSettings::new({}, {}) should be valid ", - press_threshold, release_threshold + "ButtonSettings::new({press_threshold}, {release_threshold}) should be valid" ); } } @@ -1476,8 +1471,7 @@ mod tests { match bs { Ok(_) => { panic!( - "ButtonSettings::new({}, {}) should be invalid", - press_threshold, release_threshold + "ButtonSettings::new({press_threshold}, {release_threshold}) should be invalid" ); } Err(err_code) => match err_code { diff --git a/crates/bevy_macro_utils/src/attrs.rs b/crates/bevy_macro_utils/src/attrs.rs index 34acff08f1..496ce42257 100644 --- a/crates/bevy_macro_utils/src/attrs.rs +++ b/crates/bevy_macro_utils/src/attrs.rs @@ -24,10 +24,7 @@ pub fn get_lit_str(attr_name: Symbol, lit: &syn::Lit) -> syn::Result<&syn::LitSt } else { Err(syn::Error::new_spanned( lit, - format!( - "expected {} attribute to be a string: `{} = \"...\"`", - attr_name, attr_name - ), + format!("expected {attr_name} attribute to be a string: `{attr_name} = \"...\"`"), )) } } @@ -38,10 +35,7 @@ pub fn get_lit_bool(attr_name: Symbol, lit: &syn::Lit) -> syn::Result { } else { Err(syn::Error::new_spanned( lit, - format!( - "expected {} attribute to be a bool value, `true` or `false`: `{} = ...`", - attr_name, attr_name - ), + format!("expected {attr_name} attribute to be a bool value, `true` or `false`: `{attr_name} = ...`"), )) } } diff --git a/crates/bevy_pbr/src/render/light.rs b/crates/bevy_pbr/src/render/light.rs index 38bab358d7..f0fd69b5a7 100644 --- a/crates/bevy_pbr/src/render/light.rs +++ b/crates/bevy_pbr/src/render/light.rs @@ -1190,7 +1190,7 @@ pub fn prepare_lights( .spawn(( ShadowView { depth_texture_view, - pass_name: format!("shadow pass directional light {}", light_index), + pass_name: format!("shadow pass directional light {light_index}"), }, ExtractedView { viewport: UVec4::new( diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/trait_reflection.rs b/crates/bevy_reflect/bevy_reflect_derive/src/trait_reflection.rs index 5441fa3c1f..14bd9d6d40 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/trait_reflection.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/trait_reflection.rs @@ -35,21 +35,16 @@ pub(crate) fn reflect_trait(_args: &TokenStream, input: TokenStream) -> TokenStr let bevy_reflect_path = BevyManifest::default().get_path("bevy_reflect"); let struct_doc = format!( - " A type generated by the #[reflect_trait] macro for the `{}` trait.\n\n This allows casting from `dyn Reflect` to `dyn {}`.", - trait_ident, - trait_ident + " A type generated by the #[reflect_trait] macro for the `{trait_ident}` trait.\n\n This allows casting from `dyn Reflect` to `dyn {trait_ident}`.", ); let get_doc = format!( - " Downcast a `&dyn Reflect` type to `&dyn {}`.\n\n If the type cannot be downcast, `None` is returned.", - trait_ident, + " Downcast a `&dyn Reflect` type to `&dyn {trait_ident}`.\n\n If the type cannot be downcast, `None` is returned.", ); let get_mut_doc = format!( - " Downcast a `&mut dyn Reflect` type to `&mut dyn {}`.\n\n If the type cannot be downcast, `None` is returned.", - trait_ident, + " Downcast a `&mut dyn Reflect` type to `&mut dyn {trait_ident}`.\n\n If the type cannot be downcast, `None` is returned.", ); let get_box_doc = format!( - " Downcast a `Box` type to `Box`.\n\n If the type cannot be downcast, this will return `Err(Box)`.", - trait_ident, + " Downcast a `Box` type to `Box`.\n\n If the type cannot be downcast, this will return `Err(Box)`.", ); TokenStream::from(quote! { diff --git a/crates/bevy_reflect/src/serde/de.rs b/crates/bevy_reflect/src/serde/de.rs index 799ccf3355..60d3b0aa20 100644 --- a/crates/bevy_reflect/src/serde/de.rs +++ b/crates/bevy_reflect/src/serde/de.rs @@ -467,16 +467,14 @@ impl<'a, 'de> DeserializeSeed<'de> for TypedReflectDeserializer<'a> { TypeInfo::Value(_) => { // This case should already be handled Err(de::Error::custom(format_args!( - "the TypeRegistration for {} doesn't have ReflectDeserialize", - type_name + "the TypeRegistration for {type_name} doesn't have ReflectDeserialize", ))) } TypeInfo::Dynamic(_) => { // We could potentially allow this but we'd have no idea what the actual types of the // fields are and would rely on the deserializer to determine them (e.g. `i32` vs `i64`) Err(de::Error::custom(format_args!( - "cannot deserialize arbitrary dynamic type {}", - type_name + "cannot deserialize arbitrary dynamic type {type_name}", ))) } } @@ -1080,10 +1078,7 @@ fn get_registration<'a, E: Error>( registry: &'a TypeRegistry, ) -> Result<&'a TypeRegistration, E> { let registration = registry.get(type_id).ok_or_else(|| { - Error::custom(format_args!( - "no registration found for type `{}`", - type_name - )) + Error::custom(format_args!("no registration found for type `{type_name}`",)) })?; Ok(registration) } diff --git a/crates/bevy_reflect/src/serde/ser.rs b/crates/bevy_reflect/src/serde/ser.rs index 6403b5e999..e9e4abe1d8 100644 --- a/crates/bevy_reflect/src/serde/ser.rs +++ b/crates/bevy_reflect/src/serde/ser.rs @@ -56,8 +56,7 @@ fn get_type_info( TypeInfo::Dynamic(..) => match registry.get_with_name(type_name) { Some(registration) => Ok(registration.type_info()), None => Err(Error::custom(format_args!( - "no registration found for dynamic type with name {}", - type_name + "no registration found for dynamic type with name {type_name}", ))), }, info => Ok(info), @@ -197,8 +196,7 @@ impl<'a> Serialize for StructSerializer<'a> { TypeInfo::Struct(struct_info) => struct_info, info => { return Err(Error::custom(format_args!( - "expected struct type but received {:?}", - info + "expected struct type but received {info:?}" ))); } }; @@ -247,8 +245,7 @@ impl<'a> Serialize for TupleStructSerializer<'a> { TypeInfo::TupleStruct(tuple_struct_info) => tuple_struct_info, info => { return Err(Error::custom(format_args!( - "expected tuple struct type but received {:?}", - info + "expected tuple struct type but received {info:?}" ))); } }; @@ -296,8 +293,7 @@ impl<'a> Serialize for EnumSerializer<'a> { TypeInfo::Enum(enum_info) => enum_info, info => { return Err(Error::custom(format_args!( - "expected enum type but received {:?}", - info + "expected enum type but received {info:?}" ))); } }; @@ -308,8 +304,7 @@ impl<'a> Serialize for EnumSerializer<'a> { .variant_at(variant_index as usize) .ok_or_else(|| { Error::custom(format_args!( - "variant at index `{}` does not exist", - variant_index + "variant at index `{variant_index}` does not exist", )) })?; let variant_name = variant_info.name(); @@ -333,8 +328,7 @@ impl<'a> Serialize for EnumSerializer<'a> { VariantInfo::Struct(struct_info) => struct_info, info => { return Err(Error::custom(format_args!( - "expected struct variant type but received {:?}", - info + "expected struct variant type but received {info:?}", ))); } }; diff --git a/crates/bevy_render/src/texture/basis.rs b/crates/bevy_render/src/texture/basis.rs index b404c4d386..886a0cb9bb 100644 --- a/crates/bevy_render/src/texture/basis.rs +++ b/crates/bevy_render/src/texture/basis.rs @@ -33,14 +33,12 @@ pub fn basis_buffer_to_image( let basis_texture_format = transcoder.basis_texture_format(buffer); if !basis_texture_format.can_transcode_to_format(transcode_format) { return Err(TextureError::UnsupportedTextureFormat(format!( - "{:?} cannot be transcoded to {:?}", - basis_texture_format, transcode_format + "{basis_texture_format:?} cannot be transcoded to {transcode_format:?}", ))); } transcoder.prepare_transcoding(buffer).map_err(|_| { TextureError::TranscodeError(format!( - "Failed to prepare for transcoding from {:?}", - basis_texture_format + "Failed to prepare for transcoding from {basis_texture_format:?}", )) })?; let mut transcoded = Vec::new(); @@ -49,8 +47,7 @@ pub fn basis_buffer_to_image( let texture_type = transcoder.basis_texture_type(buffer); if texture_type == BasisTextureType::TextureTypeCubemapArray && image_count % 6 != 0 { return Err(TextureError::InvalidData(format!( - "Basis file with cube map array texture with non-modulo 6 number of images: {}", - image_count, + "Basis file with cube map array texture with non-modulo 6 number of images: {image_count}", ))); } @@ -74,10 +71,7 @@ pub fn basis_buffer_to_image( let mip_level_count = transcoder.image_level_count(buffer, image_index); if mip_level_count != image0_mip_level_count { return Err(TextureError::InvalidData(format!( - "Array or volume texture has inconsistent number of mip levels. Image {} has {} but image 0 has {}", - image_index, - mip_level_count, - image0_mip_level_count, + "Array or volume texture has inconsistent number of mip levels. Image {image_index} has {mip_level_count} but image 0 has {image0_mip_level_count}", ))); } for level_index in 0..mip_level_count { @@ -94,8 +88,7 @@ pub fn basis_buffer_to_image( ) .map_err(|error| { TextureError::TranscodeError(format!( - "Failed to transcode mip level {} from {:?} to {:?}: {:?}", - level_index, basis_texture_format, transcode_format, error + "Failed to transcode mip level {level_index} from {basis_texture_format:?} to {transcode_format:?}: {error:?}", )) })?; transcoded.append(&mut data); @@ -118,8 +111,7 @@ pub fn basis_buffer_to_image( BasisTextureType::TextureTypeVolume => TextureDimension::D3, basis_texture_type => { return Err(TextureError::UnsupportedTextureFormat(format!( - "{:?}", - basis_texture_type + "{basis_texture_type:?}", ))) } }; diff --git a/crates/bevy_render/src/texture/dds.rs b/crates/bevy_render/src/texture/dds.rs index 5d3e0efe64..bd008a3600 100644 --- a/crates/bevy_render/src/texture/dds.rs +++ b/crates/bevy_render/src/texture/dds.rs @@ -14,8 +14,7 @@ pub fn dds_buffer_to_image( let texture_format = dds_format_to_texture_format(&dds, is_srgb)?; if !supported_compressed_formats.supports(texture_format) { return Err(TextureError::UnsupportedTextureFormat(format!( - "Format not supported by this GPU: {:?}", - texture_format + "Format not supported by this GPU: {texture_format:?}", ))); } let mut image = Image::default(); @@ -116,8 +115,7 @@ pub fn dds_format_to_texture_format( | D3DFormat::YUY2 | D3DFormat::CXV8U8 => { return Err(TextureError::UnsupportedTextureFormat(format!( - "{:?}", - d3d_format + "{d3d_format:?}", ))) } } @@ -227,8 +225,7 @@ pub fn dds_format_to_texture_format( } _ => { return Err(TextureError::UnsupportedTextureFormat(format!( - "{:?}", - dxgi_format + "{dxgi_format:?}", ))) } } diff --git a/crates/bevy_render/src/texture/ktx2.rs b/crates/bevy_render/src/texture/ktx2.rs index 17cb8b435c..9ad1ec9dbf 100644 --- a/crates/bevy_render/src/texture/ktx2.rs +++ b/crates/bevy_render/src/texture/ktx2.rs @@ -51,8 +51,7 @@ pub fn ktx2_buffer_to_image( let mut decompressed = Vec::new(); decoder.read_to_end(&mut decompressed).map_err(|err| { TextureError::SuperDecompressionError(format!( - "Failed to decompress {:?} for mip {}: {:?}", - supercompression_scheme, _level, err + "Failed to decompress {supercompression_scheme:?} for mip {_level}: {err:?}", )) })?; levels.push(decompressed); @@ -65,16 +64,14 @@ pub fn ktx2_buffer_to_image( let mut decompressed = Vec::new(); decoder.read_to_end(&mut decompressed).map_err(|err| { TextureError::SuperDecompressionError(format!( - "Failed to decompress {:?} for mip {}: {:?}", - supercompression_scheme, _level, err + "Failed to decompress {supercompression_scheme:?} for mip {_level}: {err:?}", )) })?; levels.push(decompressed); } _ => { return Err(TextureError::SuperDecompressionError(format!( - "Unsupported supercompression scheme: {:?}", - supercompression_scheme + "Unsupported supercompression scheme: {supercompression_scheme:?}", ))); } } @@ -159,8 +156,7 @@ pub fn ktx2_buffer_to_image( .map(|mut transcoded_level| transcoded[level].append(&mut transcoded_level)) .map_err(|error| { TextureError::SuperDecompressionError(format!( - "Failed to transcode mip level {} from UASTC to {:?}: {:?}", - level, transcode_block_format, error + "Failed to transcode mip level {level} from UASTC to {transcode_block_format:?}: {error:?}", )) })?; offset += level_bytes; @@ -193,8 +189,7 @@ pub fn ktx2_buffer_to_image( })?; if !supported_compressed_formats.supports(texture_format) { return Err(TextureError::UnsupportedTextureFormat(format!( - "Format not supported by this GPU: {:?}", - texture_format + "Format not supported by this GPU: {texture_format:?}", ))); } @@ -510,8 +505,7 @@ pub fn ktx2_dfd_to_texture_format( }, v => { return Err(TextureError::UnsupportedTextureFormat(format!( - "Unsupported sample bit length for RGBSDA 1-channel format: {}", - v + "Unsupported sample bit length for RGBSDA 1-channel format: {v}", ))); } } @@ -593,8 +587,7 @@ pub fn ktx2_dfd_to_texture_format( }, v => { return Err(TextureError::UnsupportedTextureFormat(format!( - "Unsupported sample bit length for RGBSDA 2-channel format: {}", - v + "Unsupported sample bit length for RGBSDA 2-channel format: {v}", ))); } } @@ -829,16 +822,14 @@ pub fn ktx2_dfd_to_texture_format( }, v => { return Err(TextureError::UnsupportedTextureFormat(format!( - "Unsupported sample bit length for RGBSDA 4-channel format: {}", - v + "Unsupported sample bit length for RGBSDA 4-channel format: {v}", ))); } } } v => { return Err(TextureError::UnsupportedTextureFormat(format!( - "Unsupported channel count for RGBSDA format: {}", - v + "Unsupported channel count for RGBSDA format: {v}", ))); } } @@ -954,16 +945,14 @@ pub fn ktx2_dfd_to_texture_format( }, v => { return Err(TextureError::UnsupportedTextureFormat(format!( - "Unsupported sample bit length for XYZW 4-channel format: {}", - v + "Unsupported sample bit length for XYZW 4-channel format: {v}", ))); } } } v => { return Err(TextureError::UnsupportedTextureFormat(format!( - "Unsupported channel count for XYZW format: {}", - v + "Unsupported channel count for XYZW format: {v}", ))); } } @@ -1088,8 +1077,7 @@ pub fn ktx2_dfd_to_texture_format( } v => { return Err(TextureError::UnsupportedTextureFormat(format!( - "Unsupported channel count for ETC2 format: {}", - v + "Unsupported channel count for ETC2 format: {v}", ))); } }, @@ -1148,8 +1136,7 @@ pub fn ktx2_dfd_to_texture_format( 6 => DataFormat::Rg, channel_type => { return Err(TextureError::UnsupportedTextureFormat(format!( - "Invalid KTX2 UASTC channel type: {}", - channel_type + "Invalid KTX2 UASTC channel type: {channel_type}", ))) } }), @@ -1177,8 +1164,7 @@ pub fn ktx2_format_to_texture_format( ktx2::Format::R8_UNORM | ktx2::Format::R8_SRGB => { if is_srgb { return Err(TextureError::UnsupportedTextureFormat(format!( - "{:?}", - ktx2_format + "{ktx2_format:?}" ))); } TextureFormat::R8Unorm @@ -1189,8 +1175,7 @@ pub fn ktx2_format_to_texture_format( ktx2::Format::R8G8_UNORM | ktx2::Format::R8G8_SRGB => { if is_srgb { return Err(TextureError::UnsupportedTextureFormat(format!( - "{:?}", - ktx2_format + "{ktx2_format:?}" ))); } TextureFormat::Rg8Unorm @@ -1456,8 +1441,7 @@ pub fn ktx2_format_to_texture_format( } _ => { return Err(TextureError::UnsupportedTextureFormat(format!( - "{:?}", - ktx2_format + "{ktx2_format:?}" ))) } }) diff --git a/crates/bevy_render/src/view/window.rs b/crates/bevy_render/src/view/window.rs index c5b0499b08..018f193094 100644 --- a/crates/bevy_render/src/view/window.rs +++ b/crates/bevy_render/src/view/window.rs @@ -192,8 +192,7 @@ pub fn prepare_windows( .get(0) .unwrap_or_else(|| { panic!( - "No supported formats found for surface {:?} on adapter {:?}", - surface, render_adapter + "No supported formats found for surface {surface:?} on adapter {render_adapter:?}" ) }); SurfaceData { surface, format } diff --git a/crates/bevy_scene/src/serde.rs b/crates/bevy_scene/src/serde.rs index 873015105d..51b8a5ebce 100644 --- a/crates/bevy_scene/src/serde.rs +++ b/crates/bevy_scene/src/serde.rs @@ -688,9 +688,7 @@ mod tests { expected .reflect_partial_eq(received.as_ref()) .unwrap_or_default(), - "components did not match: (expected: `{:?}`, received: `{:?}`)", - expected, - received + "components did not match: (expected: `{expected:?}`, received: `{received:?}`)", ); } } diff --git a/crates/bevy_transform/src/systems.rs b/crates/bevy_transform/src/systems.rs index 53de43a513..fb237d42c2 100644 --- a/crates/bevy_transform/src/systems.rs +++ b/crates/bevy_transform/src/systems.rs @@ -92,7 +92,7 @@ unsafe fn propagate_recursive( mut changed: bool, ) { let Ok(actual_parent) = parent_query.get(entity) else { - panic!("Propagated child for {:?} has no Parent component!", entity); + panic!("Propagated child for {entity:?} has no Parent component!"); }; assert_eq!( actual_parent.get(), expected_parent, diff --git a/examples/ui/text_debug.rs b/examples/ui/text_debug.rs index 891ab36311..040f2344c0 100644 --- a/examples/ui/text_debug.rs +++ b/examples/ui/text_debug.rs @@ -173,8 +173,7 @@ fn change_text_system( } text.sections[0].value = format!( - "This text changes in the bottom right - {:.1} fps, {:.3} ms/frame", - fps, frame_time, + "This text changes in the bottom right - {fps:.1} fps, {frame_time:.3} ms/frame", ); text.sections[2].value = format!("{fps:.1}");