From 64efd08e13c55598587f3071070f750f8945e28e Mon Sep 17 00:00:00 2001 From: Benjamin Brienen Date: Fri, 27 Dec 2024 01:40:06 +0100 Subject: [PATCH] Prefer `Display` over `Debug` (#16112) # Objective Fixes #16104 ## Solution I removed all instances of `:?` and put them back one by one where it caused an error. I removed some bevy_utils helper functions that were only used in 2 places and don't add value. See: #11478 ## Testing CI should catch the mistakes ## Migration Guide `bevy::utils::{dbg,info,warn,error}` were removed. Use `bevy::utils::tracing::{debug,info,warn,error}` instead. --------- Co-authored-by: SpecificProtagonist --- crates/bevy_animation/src/lib.rs | 4 +-- crates/bevy_asset/src/io/file/file_watcher.rs | 6 ++-- crates/bevy_asset/src/io/file/mod.rs | 5 ++-- crates/bevy_asset/src/lib.rs | 4 +-- crates/bevy_asset/src/processor/mod.rs | 15 ++++++---- crates/bevy_asset/src/server/info.rs | 2 +- crates/bevy_asset/src/server/mod.rs | 4 +-- crates/bevy_audio/src/audio_output.rs | 2 +- crates/bevy_color/src/testing.rs | 2 +- crates/bevy_ecs/README.md | 6 ++-- crates/bevy_ecs/examples/change_detection.rs | 6 ++-- crates/bevy_ecs/examples/events.rs | 2 +- crates/bevy_ecs/src/observer/runner.rs | 2 +- crates/bevy_ecs/src/query/filter.rs | 2 +- crates/bevy_ecs/src/removal_detection.rs | 2 +- crates/bevy_ecs/src/system/commands/mod.rs | 10 +++---- crates/bevy_ecs/src/system/mod.rs | 7 +++-- crates/bevy_ecs/src/system/query.rs | 4 +-- crates/bevy_ecs/src/world/mod.rs | 10 +++---- crates/bevy_ecs/src/world/reflect.rs | 2 +- crates/bevy_gltf/src/loader.rs | 12 ++++---- crates/bevy_hierarchy/src/hierarchy.rs | 4 +-- crates/bevy_input/src/gamepad.rs | 8 +++--- .../bevy_math/src/sampling/shape_sampling.rs | 8 +++--- crates/bevy_pbr/src/pbr_material.rs | 2 +- crates/bevy_picking/src/lib.rs | 2 +- crates/bevy_reflect/src/func/registry.rs | 2 +- .../src/serde/ser/serialize_with_registry.rs | 2 +- crates/bevy_render/src/gpu_readback.rs | 2 +- crates/bevy_render/src/mesh/allocator.rs | 2 +- crates/bevy_render/src/render_graph/node.rs | 2 +- .../src/render_resource/pipeline_cache.rs | 2 +- .../bevy_render/src/view/window/screenshot.rs | 6 ++-- crates/bevy_scene/src/serde.rs | 2 +- crates/bevy_text/src/text.rs | 14 +++++----- crates/bevy_ui/src/layout/debug.rs | 4 +-- crates/bevy_ui/src/layout/mod.rs | 8 +++--- crates/bevy_utils/src/lib.rs | 28 ------------------- crates/bevy_winit/src/system.rs | 14 ++++------ crates/bevy_winit/src/winit_windows.rs | 2 +- examples/2d/texture_atlas.rs | 2 +- examples/app/log_layers.rs | 6 ++-- examples/asset/custom_asset.rs | 2 +- examples/asset/custom_asset_reader.rs | 2 +- examples/ecs/change_detection.rs | 4 +-- examples/ecs/component_hooks.rs | 4 +-- examples/ecs/custom_query_param.rs | 8 +++--- examples/ecs/dynamic.rs | 6 ++-- examples/ecs/observers.rs | 2 +- examples/ecs/send_and_receive_events.rs | 2 +- examples/ecs/system_closure.rs | 6 ++-- examples/ecs/system_piping.rs | 18 ++++++++---- examples/input/gamepad_input.rs | 8 +++--- examples/input/gamepad_input_events.rs | 4 +-- examples/input/touch_input.rs | 8 +++--- .../tools/scene_viewer/animation_plugin.rs | 6 ++-- .../tools/scene_viewer/morph_viewer_plugin.rs | 4 +-- tools/compile_fail_utils/src/lib.rs | 8 ++++-- tools/example-showcase/src/main.rs | 2 +- 59 files changed, 155 insertions(+), 170 deletions(-) diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs index f1bd8c317e6c3..d7375d674cccf 100644 --- a/crates/bevy_animation/src/lib.rs +++ b/crates/bevy_animation/src/lib.rs @@ -1057,8 +1057,8 @@ pub fn animate_targets( (player, graph_handle.id()) } else { trace!( - "Either an animation player {:?} or a graph was missing for the target \ - entity {:?} ({:?}); no animations will play this frame", + "Either an animation player {} or a graph was missing for the target \ + entity {} ({:?}); no animations will play this frame", player_id, entity_mut.id(), entity_mut.get::(), diff --git a/crates/bevy_asset/src/io/file/file_watcher.rs b/crates/bevy_asset/src/io/file/file_watcher.rs index bb4cf109c32c1..a7024a4400898 100644 --- a/crates/bevy_asset/src/io/file/file_watcher.rs +++ b/crates/bevy_asset/src/io/file/file_watcher.rs @@ -49,9 +49,9 @@ impl AssetWatcher for FileWatcher {} pub(crate) fn get_asset_path(root: &Path, absolute_path: &Path) -> (PathBuf, bool) { let relative_path = absolute_path.strip_prefix(root).unwrap_or_else(|_| { panic!( - "FileWatcher::get_asset_path() failed to strip prefix from absolute path: absolute_path={:?}, root={:?}", - absolute_path, - root + "FileWatcher::get_asset_path() failed to strip prefix from absolute path: absolute_path={}, root={}", + absolute_path.display(), + root.display() ) }); let is_meta = relative_path diff --git a/crates/bevy_asset/src/io/file/mod.rs b/crates/bevy_asset/src/io/file/mod.rs index 387924001f5fd..83cc237c34df3 100644 --- a/crates/bevy_asset/src/io/file/mod.rs +++ b/crates/bevy_asset/src/io/file/mod.rs @@ -78,8 +78,9 @@ impl FileAssetWriter { if create_root { if let Err(e) = std::fs::create_dir_all(&root_path) { error!( - "Failed to create root directory {:?} for file asset writer: {:?}", - root_path, e + "Failed to create root directory {} for file asset writer: {}", + root_path.display(), + e ); } } diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs index cb14a190a335f..2568badb7e4a5 100644 --- a/crates/bevy_asset/src/lib.rs +++ b/crates/bevy_asset/src/lib.rs @@ -1684,9 +1684,9 @@ mod tests { ); } } - _ => panic!("Unexpected error type {:?}", read_error), + _ => panic!("Unexpected error type {}", read_error), }, - _ => panic!("Unexpected error type {:?}", error.error), + _ => panic!("Unexpected error type {}", error.error), } } } diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs index c74fd80b5673d..c1e9999bd017a 100644 --- a/crates/bevy_asset/src/processor/mod.rs +++ b/crates/bevy_asset/src/processor/mod.rs @@ -381,7 +381,7 @@ impl AssetProcessor { // Therefore, we shouldn't automatically delete the asset ... that is a // user-initiated action. debug!( - "Meta for asset {:?} was removed. Attempting to re-process", + "Meta for asset {} was removed. Attempting to re-process", AssetPath::from_path(&path).with_source(source.id()) ); self.process_asset(source, path).await; @@ -389,7 +389,10 @@ impl AssetProcessor { /// Removes all processed assets stored at the given path (respecting transactionality), then removes the folder itself. async fn handle_removed_folder(&self, source: &AssetSource, path: &Path) { - debug!("Removing folder {:?} because source was removed", path); + debug!( + "Removing folder {} because source was removed", + path.display() + ); let processed_reader = source.processed_reader().unwrap(); match processed_reader.read_directory(path).await { Ok(mut path_stream) => { @@ -739,7 +742,7 @@ impl AssetProcessor { ) -> Result { // TODO: The extension check was removed now that AssetPath is the input. is that ok? // TODO: check if already processing to protect against duplicate hot-reload events - debug!("Processing {:?}", asset_path); + debug!("Processing {}", asset_path); let server = &self.server; let path = asset_path.path(); let reader = source.reader(); @@ -1237,7 +1240,7 @@ impl ProcessorAssetInfos { ) { match result { Ok(ProcessResult::Processed(processed_info)) => { - debug!("Finished processing \"{:?}\"", asset_path); + debug!("Finished processing \"{}\"", asset_path); // clean up old dependents let old_processed_info = self .infos @@ -1260,7 +1263,7 @@ impl ProcessorAssetInfos { } } Ok(ProcessResult::SkippedNotChanged) => { - debug!("Skipping processing (unchanged) \"{:?}\"", asset_path); + debug!("Skipping processing (unchanged) \"{}\"", asset_path); let info = self.get_mut(&asset_path).expect("info should exist"); // NOTE: skipping an asset on a given pass doesn't mean it won't change in the future as a result // of a dependency being re-processed. This means apps might receive an "old" (but valid) asset first. @@ -1271,7 +1274,7 @@ impl ProcessorAssetInfos { info.update_status(ProcessStatus::Processed).await; } Ok(ProcessResult::Ignored) => { - debug!("Skipping processing (ignored) \"{:?}\"", asset_path); + debug!("Skipping processing (ignored) \"{}\"", asset_path); } Err(ProcessError::ExtensionRequired) => { // Skip assets without extensions diff --git a/crates/bevy_asset/src/server/info.rs b/crates/bevy_asset/src/server/info.rs index 898b3a76ec46f..9b3edd5d8c8c9 100644 --- a/crates/bevy_asset/src/server/info.rs +++ b/crates/bevy_asset/src/server/info.rs @@ -443,7 +443,7 @@ impl AssetInfos { } else { // the dependency id does not exist, which implies it was manually removed or never existed in the first place warn!( - "Dependency {:?} from asset {:?} is unknown. This asset's dependency load status will not switch to 'Loaded' until the unknown dependency is loaded.", + "Dependency {} from asset {} is unknown. This asset's dependency load status will not switch to 'Loaded' until the unknown dependency is loaded.", dep_id, loaded_asset_id ); true diff --git a/crates/bevy_asset/src/server/mod.rs b/crates/bevy_asset/src/server/mod.rs index bfeb7a40f99f2..0270aefc66eeb 100644 --- a/crates/bevy_asset/src/server/mod.rs +++ b/crates/bevy_asset/src/server/mod.rs @@ -906,7 +906,7 @@ impl AssetServer { .spawn(async move { let Ok(source) = server.get_source(path.source()) else { error!( - "Failed to load {path}. AssetSource {:?} does not exist", + "Failed to load {path}. AssetSource {} does not exist", path.source() ); return; @@ -918,7 +918,7 @@ impl AssetServer { Ok(reader) => reader, Err(_) => { error!( - "Failed to load {path}. AssetSource {:?} does not have a processed AssetReader", + "Failed to load {path}. AssetSource {} does not have a processed AssetReader", path.source() ); return; diff --git a/crates/bevy_audio/src/audio_output.rs b/crates/bevy_audio/src/audio_output.rs index 45896c81ba7ac..e34b8d815285e 100644 --- a/crates/bevy_audio/src/audio_output.rs +++ b/crates/bevy_audio/src/audio_output.rs @@ -130,7 +130,7 @@ pub(crate) fn play_queued_audio_system( // the user may have made a mistake. if ear_positions.multiple_listeners() { warn!( - "Multiple SpatialListeners found. Using {:?}.", + "Multiple SpatialListeners found. Using {}.", ear_positions.query.iter().next().unwrap().0 ); } diff --git a/crates/bevy_color/src/testing.rs b/crates/bevy_color/src/testing.rs index 0c87fe226c749..6c7747e2a540b 100644 --- a/crates/bevy_color/src/testing.rs +++ b/crates/bevy_color/src/testing.rs @@ -4,7 +4,7 @@ macro_rules! assert_approx_eq { if ($x - $y).abs() >= $d { panic!( "assertion failed: `(left !== right)` \ - (left: `{:?}`, right: `{:?}`, tolerance: `{:?}`)", + (left: `{}`, right: `{}`, tolerance: `{}`)", $x, $y, $d ); } diff --git a/crates/bevy_ecs/README.md b/crates/bevy_ecs/README.md index b947644bcd346..8614dbc5e35e1 100644 --- a/crates/bevy_ecs/README.md +++ b/crates/bevy_ecs/README.md @@ -80,7 +80,7 @@ struct Position { x: f32, y: f32 } fn print_position(query: Query<(Entity, &Position)>) { for (entity, position) in &query { - println!("Entity {:?} is at position: x {}, y {}", entity, position.x, position.y); + println!("Entity {} is at position: x {}, y {}", entity, position.x, position.y); } } ``` @@ -172,7 +172,7 @@ struct Player; struct Alive; // Gets the Position component of all Entities with Player component and without the Alive -// component. +// component. fn system(query: Query<&Position, (With, Without)>) { for position in &query { } @@ -340,7 +340,7 @@ let mut world = World::new(); let entity = world.spawn_empty().id(); world.add_observer(|trigger: Trigger, mut commands: Commands| { - println!("Entity {:?} goes BOOM!", trigger.target()); + println!("Entity {} goes BOOM!", trigger.target()); commands.entity(trigger.target()).despawn(); }); diff --git a/crates/bevy_ecs/examples/change_detection.rs b/crates/bevy_ecs/examples/change_detection.rs index 41300653ba6fb..0efe2fa978726 100644 --- a/crates/bevy_ecs/examples/change_detection.rs +++ b/crates/bevy_ecs/examples/change_detection.rs @@ -80,10 +80,10 @@ fn print_changed_entities( entity_with_mutated_component: Query<(Entity, &Age), Changed>, ) { for entity in &entity_with_added_component { - println!(" {entity:?} has it's first birthday!"); + println!(" {entity} has it's first birthday!"); } for (entity, value) in &entity_with_mutated_component { - println!(" {entity:?} is now {value:?} frames old"); + println!(" {entity} is now {value:?} frames old"); } } @@ -98,7 +98,7 @@ fn age_all_entities(mut entities: Query<&mut Age>) { fn remove_old_entities(mut commands: Commands, entities: Query<(Entity, &Age)>) { for (entity, age) in &entities { if age.frames > 2 { - println!(" despawning {entity:?} due to age > 2"); + println!(" despawning {entity} due to age > 2"); commands.entity(entity).despawn(); } } diff --git a/crates/bevy_ecs/examples/events.rs b/crates/bevy_ecs/examples/events.rs index a7894ad938e23..aac9dc38bc860 100644 --- a/crates/bevy_ecs/examples/events.rs +++ b/crates/bevy_ecs/examples/events.rs @@ -57,7 +57,7 @@ fn sending_system(mut event_writer: EventWriter) { fn receiving_system(mut event_reader: EventReader) { for my_event in event_reader.read() { println!( - " Received message {:?}, with random value of {}", + " Received message {}, with random value of {}", my_event.message, my_event.random_value ); } diff --git a/crates/bevy_ecs/src/observer/runner.rs b/crates/bevy_ecs/src/observer/runner.rs index b63f4f34a5d00..c73cc477d17c3 100644 --- a/crates/bevy_ecs/src/observer/runner.rs +++ b/crates/bevy_ecs/src/observer/runner.rs @@ -198,7 +198,7 @@ pub type ObserverRunner = fn(DeferredWorld, ObserverTrigger, PtrMut, propagate: /// struct Explode; /// /// world.add_observer(|trigger: Trigger, mut commands: Commands| { -/// println!("Entity {:?} goes BOOM!", trigger.target()); +/// println!("Entity {} goes BOOM!", trigger.target()); /// commands.entity(trigger.target()).despawn(); /// }); /// diff --git a/crates/bevy_ecs/src/query/filter.rs b/crates/bevy_ecs/src/query/filter.rs index b096e801f4cc2..2540e7cc7abe3 100644 --- a/crates/bevy_ecs/src/query/filter.rs +++ b/crates/bevy_ecs/src/query/filter.rs @@ -356,7 +356,7 @@ unsafe impl QueryFilter for Without { /// # /// fn print_cool_entity_system(query: Query, Changed)>>) { /// for entity in &query { -/// println!("Entity {:?} got a new style or color", entity); +/// println!("Entity {} got a new style or color", entity); /// } /// } /// # bevy_ecs::system::assert_is_system(print_cool_entity_system); diff --git a/crates/bevy_ecs/src/removal_detection.rs b/crates/bevy_ecs/src/removal_detection.rs index 7df072ab2d39f..1aaaa01c95e69 100644 --- a/crates/bevy_ecs/src/removal_detection.rs +++ b/crates/bevy_ecs/src/removal_detection.rs @@ -134,7 +134,7 @@ impl RemovedComponentEvents { /// # #[derive(Component)] /// # struct MyComponent; /// fn react_on_removal(mut removed: RemovedComponents) { -/// removed.read().for_each(|removed_entity| println!("{:?}", removed_entity)); +/// removed.read().for_each(|removed_entity| println!("{}", removed_entity)); /// } /// # bevy_ecs::system::assert_is_system(react_on_removal); /// ``` diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index 9086ece263824..d6646bca55fef 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -452,7 +452,7 @@ impl<'w, 's> Commands<'w, 's> { #[track_caller] fn panic_no_entity(entities: &Entities, entity: Entity) -> ! { panic!( - "Attempting to create an EntityCommands for entity {entity:?}, which {}", + "Attempting to create an EntityCommands for entity {entity}, which {}", entities.entity_does_not_exist_error_details_message(entity) ); } @@ -1405,7 +1405,7 @@ impl<'a> EntityCommands<'a> { entity.insert_by_id(component_id, ptr); }); } else { - panic!("error[B0003]: {caller}: Could not insert a component {component_id:?} (with type {}) for entity {entity:?}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), world.entities().entity_does_not_exist_error_details_message(entity)); + panic!("error[B0003]: {caller}: Could not insert a component {component_id:?} (with type {}) for entity {entity}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), world.entities().entity_does_not_exist_error_details_message(entity)); } }) } @@ -1739,7 +1739,7 @@ impl<'a> EntityCommands<'a> { /// .spawn_empty() /// // Closures with this signature implement `EntityCommand`. /// .queue(|entity: EntityWorldMut| { - /// println!("Executed an EntityCommand for {:?}", entity.id()); + /// println!("Executed an EntityCommand for {}", entity.id()); /// }); /// # } /// # bevy_ecs::system::assert_is_system(my_system); @@ -2119,7 +2119,7 @@ impl<'a, T: Component> EntityEntryCommands<'a, T> { caller, ); } else { - panic!("error[B0003]: {caller}: Could not insert a bundle (of type `{}`) for {entity:?}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), world.entities().entity_does_not_exist_error_details_message(entity) ); + panic!("error[B0003]: {caller}: Could not insert a bundle (of type `{}`) for {entity}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), world.entities().entity_does_not_exist_error_details_message(entity) ); } }); self @@ -2225,7 +2225,7 @@ fn insert(bundle: T, mode: InsertMode) -> impl EntityCommand { caller, ); } else { - panic!("error[B0003]: {caller}: Could not insert a bundle (of type `{}`) for entity {entity:?}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), world.entities().entity_does_not_exist_error_details_message(entity)); + panic!("error[B0003]: {caller}: Could not insert a bundle (of type `{}`) for entity {entity}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), world.entities().entity_does_not_exist_error_details_message(entity)); } } } diff --git a/crates/bevy_ecs/src/system/mod.rs b/crates/bevy_ecs/src/system/mod.rs index ca6e83fada9d5..b5020313c6656 100644 --- a/crates/bevy_ecs/src/system/mod.rs +++ b/crates/bevy_ecs/src/system/mod.rs @@ -1652,9 +1652,10 @@ mod tests { assert_is_system(returning::<&str>.map(u64::from_str).map(Result::unwrap)); assert_is_system(static_system_param); assert_is_system( - exclusive_in_out::<(), Result<(), std::io::Error>>.map(|result| { - if let Err(error) = result { - log::error!("{:?}", error); + exclusive_in_out::<(), Result<(), std::io::Error>>.map(|_out| { + #[cfg(feature = "trace")] + if let Err(error) = _out { + tracing::error!("{}", error); } }), ); diff --git a/crates/bevy_ecs/src/system/query.rs b/crates/bevy_ecs/src/system/query.rs index cc4312761ead4..75893a1afa295 100644 --- a/crates/bevy_ecs/src/system/query.rs +++ b/crates/bevy_ecs/src/system/query.rs @@ -620,7 +620,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> { /// ) { /// for friends in &friends_query { /// for counter in counter_query.iter_many(&friends.list) { - /// println!("Friend's counter: {:?}", counter.value); + /// println!("Friend's counter: {}", counter.value); /// } /// } /// } @@ -674,7 +674,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> { /// for friends in &friends_query { /// let mut iter = counter_query.iter_many_mut(&friends.list); /// while let Some(mut counter) = iter.fetch_next() { - /// println!("Friend's counter: {:?}", counter.value); + /// println!("Friend's counter: {}", counter.value); /// counter.value += 1; /// } /// } diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index 997d9fcee7bd0..721ca20f4b7c5 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -710,7 +710,7 @@ impl World { #[track_caller] fn panic_no_entity(world: &World, entity: Entity) -> ! { panic!( - "Entity {entity:?} {}", + "Entity {entity} {}", world .entities .entity_does_not_exist_error_details_message(entity) @@ -862,7 +862,7 @@ impl World { let entity_location = self .entities() .get(entity) - .unwrap_or_else(|| panic!("Entity {entity:?} does not exist")); + .unwrap_or_else(|| panic!("Entity {entity} does not exist")); let archetype = self .archetypes() @@ -1336,7 +1336,7 @@ impl World { true } else { if log_warning { - warn!("error[B0003]: {caller}: Could not despawn entity {entity:?}, which {}. See: https://bevyengine.org/learn/errors/b0003", self.entities.entity_does_not_exist_error_details_message(entity)); + warn!("error[B0003]: {caller}: Could not despawn entity {entity}, which {}. See: https://bevyengine.org/learn/errors/b0003", self.entities.entity_does_not_exist_error_details_message(entity)); } false } @@ -2498,11 +2498,11 @@ impl World { ) }; } else { - panic!("error[B0003]: Could not insert a bundle (of type `{}`) for entity {entity:?}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), self.entities.entity_does_not_exist_error_details_message(entity)); + panic!("error[B0003]: Could not insert a bundle (of type `{}`) for entity {entity}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), self.entities.entity_does_not_exist_error_details_message(entity)); } } } else { - panic!("error[B0003]: Could not insert a bundle (of type `{}`) for entity {first_entity:?}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), self.entities.entity_does_not_exist_error_details_message(first_entity)); + panic!("error[B0003]: Could not insert a bundle (of type `{}`) for entity {first_entity}, which {}. See: https://bevyengine.org/learn/errors/b0003", core::any::type_name::(), self.entities.entity_does_not_exist_error_details_message(first_entity)); } } } diff --git a/crates/bevy_ecs/src/world/reflect.rs b/crates/bevy_ecs/src/world/reflect.rs index afa2015f4ef38..882cf9b74a78a 100644 --- a/crates/bevy_ecs/src/world/reflect.rs +++ b/crates/bevy_ecs/src/world/reflect.rs @@ -213,7 +213,7 @@ pub enum GetComponentReflectError { NoCorrespondingComponentId(TypeId), /// The given [`Entity`] does not have a [`Component`] corresponding to the given [`TypeId`]. - #[error("The given `Entity` {entity:?} does not have a `{component_name:?}` component ({component_id:?}, which corresponds to {type_id:?})")] + #[error("The given `Entity` {entity} does not have a `{component_name:?}` component ({component_id:?}, which corresponds to {type_id:?})")] EntityDoesNotHaveComponent { /// The given [`Entity`]. entity: Entity, diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index c1f6a5d2eaa43..116ecb23c39a7 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -646,13 +646,13 @@ async fn load_gltf<'a, 'b, 'c>( if [Semantic::Joints(0), Semantic::Weights(0)].contains(&semantic) { if !meshes_on_skinned_nodes.contains(&gltf_mesh.index()) { warn!( - "Ignoring attribute {:?} for skinned mesh {:?} used on non skinned nodes (NODE_SKINNED_MESH_WITHOUT_SKIN)", + "Ignoring attribute {:?} for skinned mesh {} used on non skinned nodes (NODE_SKINNED_MESH_WITHOUT_SKIN)", semantic, primitive_label ); continue; } else if meshes_on_non_skinned_nodes.contains(&gltf_mesh.index()) { - error!("Skinned mesh {:?} used on both skinned and non skin nodes, this is likely to cause an error (NODE_SKINNED_MESH_WITHOUT_SKIN)", primitive_label); + error!("Skinned mesh {} used on both skinned and non skin nodes, this is likely to cause an error (NODE_SKINNED_MESH_WITHOUT_SKIN)", primitive_label); } } match convert_attribute( @@ -737,9 +737,9 @@ async fn load_gltf<'a, 'b, 'c>( generate_tangents_span.in_scope(|| { if let Err(err) = mesh.generate_tangents() { warn!( - "Failed to generate vertex tangents using the mikktspace algorithm: {:?}", - err - ); + "Failed to generate vertex tangents using the mikktspace algorithm: {}", + err + ); } }); } @@ -1912,7 +1912,7 @@ impl<'a> GltfTreeIterator<'a> { if skin.joints().len() > MAX_JOINTS && warned_about_max_joints.insert(skin.index()) { warn!( - "The glTF skin {:?} has {} joints, but the maximum supported is {}", + "The glTF skin {} has {} joints, but the maximum supported is {}", skin.name() .map(ToString::to_string) .unwrap_or_else(|| skin.index().to_string()), diff --git a/crates/bevy_hierarchy/src/hierarchy.rs b/crates/bevy_hierarchy/src/hierarchy.rs index 37dcb83061f93..65d6aa3df8960 100644 --- a/crates/bevy_hierarchy/src/hierarchy.rs +++ b/crates/bevy_hierarchy/src/hierarchy.rs @@ -51,10 +51,10 @@ fn despawn_with_children_recursive_inner(world: &mut World, entity: Entity, warn if warn { if !world.despawn(entity) { - debug!("Failed to despawn entity {:?}", entity); + debug!("Failed to despawn entity {}", entity); } } else if !world.try_despawn(entity) { - debug!("Failed to despawn entity {:?}", entity); + debug!("Failed to despawn entity {}", entity); } } diff --git a/crates/bevy_input/src/gamepad.rs b/crates/bevy_input/src/gamepad.rs index 5d057381fe11d..92f1149a2a77e 100644 --- a/crates/bevy_input/src/gamepad.rs +++ b/crates/bevy_input/src/gamepad.rs @@ -1346,7 +1346,7 @@ pub fn gamepad_connection_system( product_id, } => { let Some(mut gamepad) = commands.get_entity(id) else { - warn!("Gamepad {:} removed before handling connection event.", id); + warn!("Gamepad {} removed before handling connection event.", id); continue; }; gamepad.insert(( @@ -1357,18 +1357,18 @@ pub fn gamepad_connection_system( ..Default::default() }, )); - info!("Gamepad {:?} connected.", id); + info!("Gamepad {} connected.", id); } GamepadConnection::Disconnected => { let Some(mut gamepad) = commands.get_entity(id) else { - warn!("Gamepad {:} removed before handling disconnection event. You can ignore this if you manually removed it.", id); + warn!("Gamepad {} removed before handling disconnection event. You can ignore this if you manually removed it.", id); continue; }; // Gamepad entities are left alive to preserve their state (e.g. [`GamepadSettings`]). // Instead of despawning, we remove Gamepad components that don't need to preserve state // and re-add them if they ever reconnect. gamepad.remove::(); - info!("Gamepad {:} disconnected.", id); + info!("Gamepad {} disconnected.", id); } } } diff --git a/crates/bevy_math/src/sampling/shape_sampling.rs b/crates/bevy_math/src/sampling/shape_sampling.rs index 68d77cd1d7f0b..d1371114bd6d3 100644 --- a/crates/bevy_math/src/sampling/shape_sampling.rs +++ b/crates/bevy_math/src/sampling/shape_sampling.rs @@ -61,7 +61,7 @@ pub trait ShapeSample { /// let square = Rectangle::new(2.0, 2.0); /// /// // Returns a Vec2 with both x and y between -1 and 1. - /// println!("{:?}", square.sample_interior(&mut rand::thread_rng())); + /// println!("{}", square.sample_interior(&mut rand::thread_rng())); /// ``` fn sample_interior(&self, rng: &mut R) -> Self::Output; @@ -76,7 +76,7 @@ pub trait ShapeSample { /// /// // Returns a Vec2 where one of the coordinates is at ±1, /// // and the other is somewhere between -1 and 1. - /// println!("{:?}", square.sample_boundary(&mut rand::thread_rng())); + /// println!("{}", square.sample_boundary(&mut rand::thread_rng())); /// ``` fn sample_boundary(&self, rng: &mut R) -> Self::Output; @@ -92,7 +92,7 @@ pub trait ShapeSample { /// /// // Iterate over points randomly drawn from `square`'s interior: /// for random_val in square.interior_dist().sample_iter(rng).take(5) { - /// println!("{:?}", random_val); + /// println!("{}", random_val); /// } /// ``` fn interior_dist(self) -> impl Distribution @@ -114,7 +114,7 @@ pub trait ShapeSample { /// /// // Iterate over points randomly drawn from `square`'s boundary: /// for random_val in square.boundary_dist().sample_iter(rng).take(5) { - /// println!("{:?}", random_val); + /// println!("{}", random_val); /// } /// ``` fn boundary_dist(self) -> impl Distribution diff --git a/crates/bevy_pbr/src/pbr_material.rs b/crates/bevy_pbr/src/pbr_material.rs index 2e93b68094e17..03d520a1c27ef 100644 --- a/crates/bevy_pbr/src/pbr_material.rs +++ b/crates/bevy_pbr/src/pbr_material.rs @@ -38,7 +38,7 @@ pub struct StandardMaterial { /// /// Doubles as diffuse albedo for non-metallic, specular for metallic and a mix for everything /// in between. If used together with a `base_color_texture`, this is factored into the final - /// base color as `base_color * base_color_texture_value` + /// base color as `base_color * base_color_texture_value`. /// /// Defaults to [`Color::WHITE`]. pub base_color: Color, diff --git a/crates/bevy_picking/src/lib.rs b/crates/bevy_picking/src/lib.rs index 03e0269fb50db..291fe9fa0ce3f 100644 --- a/crates/bevy_picking/src/lib.rs +++ b/crates/bevy_picking/src/lib.rs @@ -54,7 +54,7 @@ //! transform.rotate_local_y(drag.delta.x / 50.0); //! }) //! .observe(|trigger: Trigger>, mut commands: Commands| { -//! println!("Entity {:?} goes BOOM!", trigger.target()); +//! println!("Entity {} goes BOOM!", trigger.target()); //! commands.entity(trigger.target()).despawn(); //! }) //! .observe(|trigger: Trigger>, mut events: EventWriter| { diff --git a/crates/bevy_reflect/src/func/registry.rs b/crates/bevy_reflect/src/func/registry.rs index 82d1f1542a2b5..cd9a0d270d14f 100644 --- a/crates/bevy_reflect/src/func/registry.rs +++ b/crates/bevy_reflect/src/func/registry.rs @@ -173,7 +173,7 @@ impl FunctionRegistry { /// .register_with_name(core::any::type_name_of_val(&mul), mul)? /// // Registering an existing function with a custom name /// .register_with_name("my_crate::mul", mul)?; - /// + /// /// // Be careful not to register anonymous functions with their type name. /// // This code works but registers the function with a non-unique name like `foo::bar::{{closure}}` /// registry.register_with_name(core::any::type_name_of_val(&div), div)?; diff --git a/crates/bevy_reflect/src/serde/ser/serialize_with_registry.rs b/crates/bevy_reflect/src/serde/ser/serialize_with_registry.rs index 25922a5bd9456..9c5bfb06f1ca8 100644 --- a/crates/bevy_reflect/src/serde/ser/serialize_with_registry.rs +++ b/crates/bevy_reflect/src/serde/ser/serialize_with_registry.rs @@ -75,7 +75,7 @@ impl FromType for ReflectSerializeWithReg serialize: |value: &dyn Reflect, registry| { let value = value.downcast_ref::().unwrap_or_else(|| { panic!( - "Expected value to be of type {:?} but received {:?}", + "Expected value to be of type {} but received {}", core::any::type_name::(), value.reflect_type_path() ) diff --git a/crates/bevy_render/src/gpu_readback.rs b/crates/bevy_render/src/gpu_readback.rs index d67db45e0986b..1bed75ab0afbb 100644 --- a/crates/bevy_render/src/gpu_readback.rs +++ b/crates/bevy_render/src/gpu_readback.rs @@ -339,7 +339,7 @@ fn map_buffers(mut readbacks: ResMut) { drop(data); buffer.unmap(); if let Err(e) = tx.try_send((entity, buffer, result)) { - warn!("Failed to send readback result: {:?}", e); + warn!("Failed to send readback result: {}", e); } }); readbacks.mapped.push(readback); diff --git a/crates/bevy_render/src/mesh/allocator.rs b/crates/bevy_render/src/mesh/allocator.rs index 6e7afaa4d7cde..a4928cec6076e 100644 --- a/crates/bevy_render/src/mesh/allocator.rs +++ b/crates/bevy_render/src/mesh/allocator.rs @@ -785,7 +785,7 @@ impl MeshAllocator { slab_to_grow: SlabToReallocate, ) { let Some(Slab::General(slab)) = self.slabs.get_mut(&slab_id) else { - error!("Couldn't find slab {:?} to grow", slab_id); + error!("Couldn't find slab {} to grow", slab_id); return; }; diff --git a/crates/bevy_render/src/render_graph/node.rs b/crates/bevy_render/src/render_graph/node.rs index 91775fef7ccef..cc4875a7791a8 100644 --- a/crates/bevy_render/src/render_graph/node.rs +++ b/crates/bevy_render/src/render_graph/node.rs @@ -238,7 +238,7 @@ pub struct NodeState { impl Debug for NodeState { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - writeln!(f, "{:?} ({:?})", self.label, self.type_name) + writeln!(f, "{:?} ({})", self.label, self.type_name) } } diff --git a/crates/bevy_render/src/render_resource/pipeline_cache.rs b/crates/bevy_render/src/render_resource/pipeline_cache.rs index 0e041968de1cc..b4a7514d1d164 100644 --- a/crates/bevy_render/src/render_resource/pipeline_cache.rs +++ b/crates/bevy_render/src/render_resource/pipeline_cache.rs @@ -264,7 +264,7 @@ impl ShaderCache { )); debug!( - "processing shader {:?}, with shader defs {:?}", + "processing shader {}, with shader defs {:?}", id, shader_defs ); let shader_source = match &shader.source { diff --git a/crates/bevy_render/src/view/window/screenshot.rs b/crates/bevy_render/src/view/window/screenshot.rs index aab9b08c680d7..10bb42932e53f 100644 --- a/crates/bevy_render/src/view/window/screenshot.rs +++ b/crates/bevy_render/src/view/window/screenshot.rs @@ -239,7 +239,7 @@ fn extract_screenshots( }; if seen_targets.contains(&render_target) { warn!( - "Duplicate render target for screenshot, skipping entity {:?}: {:?}", + "Duplicate render target for screenshot, skipping entity {}: {:?}", entity, render_target ); // If we don't despawn the entity here, it will be captured again in the next frame @@ -273,7 +273,7 @@ fn prepare_screenshots( NormalizedRenderTarget::Window(window) => { let window = window.entity(); let Some(surface_data) = window_surfaces.surfaces.get(&window) else { - warn!("Unknown window for screenshot, skipping: {:?}", window); + warn!("Unknown window for screenshot, skipping: {}", window); continue; }; let format = surface_data.configuration.format.add_srgb_suffix(); @@ -690,7 +690,7 @@ pub(crate) fn collect_screenshots(world: &mut World) { RenderAssetUsages::RENDER_WORLD, ), )) { - error!("Failed to send screenshot: {:?}", e); + error!("Failed to send screenshot: {}", e); } }; diff --git a/crates/bevy_scene/src/serde.rs b/crates/bevy_scene/src/serde.rs index 0c74b8e7ee894..61369b9612934 100644 --- a/crates/bevy_scene/src/serde.rs +++ b/crates/bevy_scene/src/serde.rs @@ -935,7 +935,7 @@ mod tests { .entities .iter() .find(|dynamic_entity| dynamic_entity.entity == expected.entity) - .unwrap_or_else(|| panic!("missing entity (expected: `{:?}`)", expected.entity)); + .unwrap_or_else(|| panic!("missing entity (expected: `{}`)", expected.entity)); assert_eq!(expected.entity, received.entity, "entities did not match"); diff --git a/crates/bevy_text/src/text.rs b/crates/bevy_text/src/text.rs index 06b9eeb9902d4..9ac844c099a75 100644 --- a/crates/bevy_text/src/text.rs +++ b/crates/bevy_text/src/text.rs @@ -443,7 +443,7 @@ pub fn detect_text_needs_rerender( // - Root children changed (can include additions and removals). for root in changed_roots.iter() { let Ok((_, Some(mut computed), _)) = computed.get_mut(root) else { - warn_once!("found entity {:?} with a root text component ({}) but no ComputedTextBlock; this warning only \ + warn_once!("found entity {} with a root text component ({}) but no ComputedTextBlock; this warning only \ prints once", root, core::any::type_name::()); continue; }; @@ -456,14 +456,14 @@ pub fn detect_text_needs_rerender( // - Span children changed (can include additions and removals). for (entity, maybe_span_parent, has_text_block) in changed_spans.iter() { if has_text_block { - warn_once!("found entity {:?} with a TextSpan that has a TextLayout, which should only be on root \ + warn_once!("found entity {} with a TextSpan that has a TextLayout, which should only be on root \ text entities (that have {}); this warning only prints once", entity, core::any::type_name::()); } let Some(span_parent) = maybe_span_parent else { warn_once!( - "found entity {:?} with a TextSpan that has no parent; it should have an ancestor \ + "found entity {} with a TextSpan that has no parent; it should have an ancestor \ with a root text component ({}); this warning only prints once", entity, core::any::type_name::() @@ -477,8 +477,8 @@ pub fn detect_text_needs_rerender( // is outweighed by the expense of tracking visited spans. loop { let Ok((maybe_parent, maybe_computed, has_span)) = computed.get_mut(parent) else { - warn_once!("found entity {:?} with a TextSpan that is part of a broken hierarchy with a Parent \ - component that points at non-existent entity {:?}; this warning only prints once", + warn_once!("found entity {} with a TextSpan that is part of a broken hierarchy with a Parent \ + component that points at non-existent entity {}; this warning only prints once", entity, parent); break; }; @@ -487,14 +487,14 @@ pub fn detect_text_needs_rerender( break; } if !has_span { - warn_once!("found entity {:?} with a TextSpan that has an ancestor ({}) that does not have a text \ + warn_once!("found entity {} with a TextSpan that has an ancestor ({}) that does not have a text \ span component or a ComputedTextBlock component; this warning only prints once", entity, parent); break; } let Some(next_parent) = maybe_parent else { warn_once!( - "found entity {:?} with a TextSpan that has no ancestor with the root text \ + "found entity {} with a TextSpan that has no ancestor with the root text \ component ({}); this warning only prints once", entity, core::any::type_name::() diff --git a/crates/bevy_ui/src/layout/debug.rs b/crates/bevy_ui/src/layout/debug.rs index 359658f59dbe9..8a951cd97d9d5 100644 --- a/crates/bevy_ui/src/layout/debug.rs +++ b/crates/bevy_ui/src/layout/debug.rs @@ -27,7 +27,7 @@ pub fn print_ui_layout_tree(ui_surface: &UiSurface) { &mut out, ); } - bevy_utils::tracing::info!("Layout tree for camera entity: {entity:?}\n{out}"); + bevy_utils::tracing::info!("Layout tree for camera entity: {entity}\n{out}"); } } @@ -62,7 +62,7 @@ fn print_node( }; writeln!( acc, - "{lines}{fork} {display} [x: {x:<4} y: {y:<4} width: {width:<4} height: {height:<4}] ({entity:?}) {measured}", + "{lines}{fork} {display} [x: {x:<4} y: {y:<4} width: {width:<4} height: {height:<4}] ({entity}) {measured}", lines = lines_string, fork = fork_string, display = display_variant, diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs index af3994a766d9c..f1eb4737ead20 100644 --- a/crates/bevy_ui/src/layout/mod.rs +++ b/crates/bevy_ui/src/layout/mod.rs @@ -171,7 +171,7 @@ pub fn ui_layout_system( Some(camera_entity) => { let Ok((_, camera)) = cameras.get(camera_entity) else { warn!( - "TargetCamera (of root UI node {entity:?}) is pointing to a camera {:?} which doesn't exist", + "TargetCamera (of root UI node {entity}) is pointing to a camera {} which doesn't exist", camera_entity ); return; @@ -187,7 +187,7 @@ pub fn ui_layout_system( } else { warn!( "Multiple cameras found, causing UI target ambiguity. \ - To fix this, add an explicit `TargetCamera` component to the root UI node {:?}", + To fix this, add an explicit `TargetCamera` component to the root UI node {}", entity ); } @@ -876,12 +876,12 @@ mod tests { ); assert!( current_rect.height().abs() + current_rect.width().abs() > 0., - "root ui node {entity:?} doesn't have a logical size" + "root ui node {entity} doesn't have a logical size" ); assert_ne!( global_transform.affine(), GlobalTransform::default().affine(), - "root ui node {entity:?} global transform is not populated" + "root ui node {entity} global transform is not populated" ); let Some((rect, is_overlapping)) = option_rect else { return Some((current_rect, false)); diff --git a/crates/bevy_utils/src/lib.rs b/crates/bevy_utils/src/lib.rs index a6199bc6ce20b..4e344fc0cf76d 100644 --- a/crates/bevy_utils/src/lib.rs +++ b/crates/bevy_utils/src/lib.rs @@ -400,34 +400,6 @@ impl Drop for OnDrop { } } -/// Calls the [`tracing::info!`] macro on a value. -#[cfg(feature = "tracing")] -pub fn info(data: T) { - tracing::info!("{:?}", data); -} - -/// Calls the [`tracing::debug!`] macro on a value. -#[cfg(feature = "tracing")] -pub fn dbg(data: T) { - tracing::debug!("{:?}", data); -} - -/// Processes a [`Result`] by calling the [`tracing::warn!`] macro in case of an [`Err`] value. -#[cfg(feature = "tracing")] -pub fn warn(result: Result<(), E>) { - if let Err(warn) = result { - tracing::warn!("{:?}", warn); - } -} - -/// Processes a [`Result`] by calling the [`tracing::error!`] macro in case of an [`Err`] value. -#[cfg(feature = "tracing")] -pub fn error(result: Result<(), E>) { - if let Err(error) = result { - tracing::error!("{:?}", error); - } -} - /// Like [`tracing::trace`], but conditional on cargo feature `detailed_trace`. #[cfg(feature = "tracing")] #[macro_export] diff --git a/crates/bevy_winit/src/system.rs b/crates/bevy_winit/src/system.rs index 113e5d4a44540..5a7a32d55613c 100644 --- a/crates/bevy_winit/src/system.rs +++ b/crates/bevy_winit/src/system.rs @@ -61,11 +61,7 @@ pub fn create_windows( continue; } - info!( - "Creating new window {:?} ({:?})", - window.title.as_str(), - entity - ); + info!("Creating new window {} ({})", window.title.as_str(), entity); let winit_window = winit_windows.create_window( event_loop, @@ -209,7 +205,7 @@ pub fn create_monitors( idx += 1; true } else { - info!("Monitor removed {:?}", entity); + info!("Monitor removed {}", entity); commands.entity(*entity).despawn(); idx += 1; false @@ -234,7 +230,7 @@ pub(crate) fn despawn_windows( closing_events.send(WindowClosing { window }); } for window in closed.read() { - info!("Closing window {:?}", window); + info!("Closing window {}", window); // Guard to verify that the window is in fact actually gone, // rather than having the component added // and removed in the same frame. @@ -390,7 +386,7 @@ pub(crate) fn changed_windows( let position = PhysicalPosition::new(physical_position.x, physical_position.y); if let Err(err) = winit_window.set_cursor_position(position) { - error!("could not set cursor position: {:?}", err); + error!("could not set cursor position: {}", err); } } } @@ -410,7 +406,7 @@ pub(crate) fn changed_windows( if let Err(err) = winit_window.set_cursor_hittest(window.cursor_options.hit_test) { window.cursor_options.hit_test = cache.window.cursor_options.hit_test; warn!( - "Could not set cursor hit test for window {:?}: {:?}", + "Could not set cursor hit test for window {}: {}", window.title, err ); } diff --git a/crates/bevy_winit/src/winit_windows.rs b/crates/bevy_winit/src/winit_windows.rs index ff08b20b4053d..3d91be9531a32 100644 --- a/crates/bevy_winit/src/winit_windows.rs +++ b/crates/bevy_winit/src/winit_windows.rs @@ -290,7 +290,7 @@ impl WinitWindows { if !window.cursor_options.hit_test { if let Err(err) = winit_window.set_cursor_hittest(window.cursor_options.hit_test) { warn!( - "Could not set cursor hit test for window {:?}: {:?}", + "Could not set cursor hit test for window {}: {}", window.title, err ); } diff --git a/examples/2d/texture_atlas.rs b/examples/2d/texture_atlas.rs index 502285c9acb75..43822ad4fe449 100644 --- a/examples/2d/texture_atlas.rs +++ b/examples/2d/texture_atlas.rs @@ -228,7 +228,7 @@ fn create_texture_atlas( let id = handle.id().typed_unchecked::(); let Some(texture) = textures.get(id) else { warn!( - "{:?} did not resolve to an `Image` asset.", + "{} did not resolve to an `Image` asset.", handle.path().unwrap() ); continue; diff --git a/examples/app/log_layers.rs b/examples/app/log_layers.rs index fa7ddd1470bde..36fdb6c4e58e3 100644 --- a/examples/app/log_layers.rs +++ b/examples/app/log_layers.rs @@ -15,9 +15,9 @@ impl Layer for CustomLayer { _ctx: bevy::log::tracing_subscriber::layer::Context<'_, S>, ) { println!("Got event!"); - println!(" level={:?}", event.metadata().level()); - println!(" target={:?}", event.metadata().target()); - println!(" name={:?}", event.metadata().name()); + println!(" level={}", event.metadata().level()); + println!(" target={}", event.metadata().target()); + println!(" name={}", event.metadata().name()); } } diff --git a/examples/asset/custom_asset.rs b/examples/asset/custom_asset.rs index 45acc0d673501..b22a617404271 100644 --- a/examples/asset/custom_asset.rs +++ b/examples/asset/custom_asset.rs @@ -149,7 +149,7 @@ fn print_on_load( info!("Custom asset loaded: {:?}", custom_asset.unwrap()); info!("Custom asset loaded: {:?}", other_custom_asset.unwrap()); - info!("Blob Size: {:?} Bytes", blob.unwrap().bytes.len()); + info!("Blob Size: {} Bytes", blob.unwrap().bytes.len()); // Once printed, we won't print again state.printed = true; diff --git a/examples/asset/custom_asset_reader.rs b/examples/asset/custom_asset_reader.rs index eacb13e4385c3..4241725784014 100644 --- a/examples/asset/custom_asset_reader.rs +++ b/examples/asset/custom_asset_reader.rs @@ -16,7 +16,7 @@ struct CustomAssetReader(Box); impl AssetReader for CustomAssetReader { async fn read<'a>(&'a self, path: &'a Path) -> Result { - info!("Reading {:?}", path); + info!("Reading {}", path.display()); self.0.read(path).await } async fn read_meta<'a>(&'a self, path: &'a Path) -> Result { diff --git a/examples/ecs/change_detection.rs b/examples/ecs/change_detection.rs index 9d5d3fde9d57f..e7d659cab661c 100644 --- a/examples/ecs/change_detection.rs +++ b/examples/ecs/change_detection.rs @@ -36,7 +36,7 @@ fn change_component(time: Res