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
This commit is contained in:
anarelion 2023-10-22 23:59:39 +01:00 committed by GitHub
parent 60773e6787
commit f9ef989def
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}")?;