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:
parent
00323b3048
commit
1c6be94f4f
@ -154,7 +154,7 @@ impl<'a, 'b> From<&'a AssetPath<'b>> for AssetPathId {
|
|||||||
|
|
||||||
impl<'a> From<&'a str> for AssetPath<'a> {
|
impl<'a> From<&'a str> for AssetPath<'a> {
|
||||||
fn from(asset_path: &'a str) -> Self {
|
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 path = Path::new(parts.next().expect("Path must be set."));
|
||||||
let label = parts.next();
|
let label = parts.next();
|
||||||
AssetPath {
|
AssetPath {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user