Skip to content

Commit

Permalink
Implement source into Display for AssetPath (bevyengine#10217)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
anarelion authored Oct 22, 2023
1 parent 60773e6 commit f9ef989
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/bevy_asset/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}")?;
Expand Down

0 comments on commit f9ef989

Please sign in to comment.