From 750799724ec1e3d37fc53c36daf2d88a5264ee01 Mon Sep 17 00:00:00 2001 From: Talin Date: Fri, 22 Sep 2023 11:02:51 -0700 Subject: [PATCH] Rebased to latest main. --- crates/bevy_asset/src/path.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/bevy_asset/src/path.rs b/crates/bevy_asset/src/path.rs index 8ea427427673c0..5ff1e4fc8f278e 100644 --- a/crates/bevy_asset/src/path.rs +++ b/crates/bevy_asset/src/path.rs @@ -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())), @@ -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), + } } }