Skip to content

Commit

Permalink
Rebased to latest main.
Browse files Browse the repository at this point in the history
  • Loading branch information
viridia committed Sep 22, 2023
1 parent dce78bd commit 7507997
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/bevy_asset/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ impl<'a> AssetPath<'a> {
///
/// This method will panic if the path argument has more 'parent' elements ("../") than
/// are available in the base path.
pub fn resolve(&'a self, path: &'a str) -> AssetPath<'a> {
pub fn resolve<'b>(&'a self, path: &'b str) -> AssetPath<'a> {
if let Some(label) = path.strip_prefix('#') {
// It's a label only
AssetPath::new_ref(&self.path, Some(label))
self.clone().into_owned().with_label(label.to_owned())
} else {
let (rpath, rlabel) = match path.split_once('#') {
Some((path, label)) => (path, Some(label.to_string())),
Expand Down Expand Up @@ -209,7 +209,10 @@ impl<'a> AssetPath<'a> {
first = false;
}

AssetPath::new(fpath, rlabel)
match rlabel {
Some(label) => AssetPath::from(fpath).with_label(label),
None => AssetPath::from(fpath),
}
}
}

Expand Down

0 comments on commit 7507997

Please sign in to comment.