Skip to content

Commit

Permalink
Correctly parse labels with '#' (#5729)
Browse files Browse the repository at this point in the history
# Objective

- Fixes #5707 

## Solution

- Used `splitn` instead of `split` to collect the rest of the string into the label after the first '#'.

---
  • Loading branch information
merelymyself committed Aug 18, 2022
1 parent 00323b3 commit 1c6be94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_asset/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1c6be94

Please sign in to comment.