/// Improve the path to remove and solve .. token.
///
/// This will be removed when this issue is solved: https://github.com/rust-lang/rfcs/issues/2208
///
/// Note that this operation might be a little too optimistic in some cases
/// of aliases but it's probably OK in broot.
Improve the path to remove and solve .. token.

Note that this operation might be a little too optimistic in some cases
of aliases but it's probably OK in broot.
Improve the path to remove and solve .. token . Note that this operation might be a little too optimistic in some cases of aliases but it ' s probably OK in broot .
pub fn normalize_path(mut path: String) -> String {
    let mut len_before = path.len();
    loop {
        path = regex!(r"/[^/.\\]+/\.\.").replace(&path, "").to_string();
        let len = path.len();
        if len == len_before {
            return path;
        }
        len_before = len;
    }
}
pub fn normalize_path ( mut path : String ) -> String { let mut len_before = path . len ( ) ; loop { path = regex ! ( r"/[^/.\\]+/\.\." ) . replace ( & path , " " ) . to_string ( ) ; let len = path . len ( ) ; if len == len_before { return path ; } len_before = len ; } }
Improve the path to remove and solve .. token.
Improve the path to remove and solve .. token .
path
String