Skip to content

Commit

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

- Fixes bevyengine#5707 

## Solution

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

---
  • Loading branch information
merelymyself authored and ItsDoot committed Feb 1, 2023
1 parent 246bd0e commit deed459
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 deed459

Please sign in to comment.