From f9ef989def5a77d0e0a37c70a0a26939e0b9b3a3 Mon Sep 17 00:00:00 2001 From: anarelion Date: Sun, 22 Oct 2023 23:59:39 +0100 Subject: [PATCH] Implement source into Display for AssetPath (#10217) # Objective When debugging and printing asset paths, I am not 100% if I am in the right source or not ## Solution Add the output of the source --- crates/bevy_asset/src/path.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/bevy_asset/src/path.rs b/crates/bevy_asset/src/path.rs index 43b7d2cab5c77..a6cf38db73848 100644 --- a/crates/bevy_asset/src/path.rs +++ b/crates/bevy_asset/src/path.rs @@ -67,6 +67,9 @@ impl<'a> Debug for AssetPath<'a> { impl<'a> Display for AssetPath<'a> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + if let AssetSourceId::Name(name) = self.source() { + write!(f, "{name}://")?; + } write!(f, "{}", self.path.display())?; if let Some(label) = &self.label { write!(f, "#{label}")?;