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 '#'.

---
This commit is contained in:
pwygab 2022-08-18 18:53:09 +00:00
parent 00323b3048
commit 1c6be94f4f

View File

@ -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 {