From 1c6be94f4fceb36ed0b52a5807bf431b1890b390 Mon Sep 17 00:00:00 2001 From: pwygab <88221256+merelymyself@users.noreply.github.com> Date: Thu, 18 Aug 2022 18:53:09 +0000 Subject: [PATCH] Correctly parse labels with '#' (#5729) # Objective - Fixes #5707 ## Solution - Used `splitn` instead of `split` to collect the rest of the string into the label after the first '#'. --- --- crates/bevy_asset/src/path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_asset/src/path.rs b/crates/bevy_asset/src/path.rs index d47bca18e7617..1cfbc87dcc33d 100644 --- a/crates/bevy_asset/src/path.rs +++ b/crates/bevy_asset/src/path.rs @@ -154,7 +154,7 @@ impl<'a, 'b> From<&'a AssetPath<'b>> for AssetPathId { impl<'a> From<&'a str> for AssetPath<'a> { fn from(asset_path: &'a str) -> Self { - let mut parts = asset_path.split('#'); + let mut parts = asset_path.splitn(2, '#'); let path = Path::new(parts.next().expect("Path must be set.")); let label = parts.next(); AssetPath {