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 and robtfm committed Oct 23, 2023
1 parent 6f01d62 commit 88a9701
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 88a9701

Please sign in to comment.