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 james7132 committed Oct 28, 2022
1 parent 8093913 commit eb22f03
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 eb22f03

Please sign in to comment.