src/cleanpath_aggressive.rs in faster_path-0.2.5 vs src/cleanpath_aggressive.rs in faster_path-0.2.6
- old
+ new
@@ -8,10 +8,10 @@
pub fn cleanpath_aggressive(path: &str) -> String {
let sep = MAIN_SEPARATOR.to_string();
let mut names: Vec<String> = vec![];
let mut pre = path.to_string();
loop {
- match chop_basename(&pre) {
+ match chop_basename(&pre.clone()) {
Some((ref p, ref base)) => {
pre = p.to_string();
match base.as_ref() {
"." => {},
".." => names.unshift(base.to_string()),