// Unescape delimiters in the given path to give clients the 'real' path
// when extracting paths from the packaged part of a package-relative path.
//
// If path is a package-relative path, we assume the packaged portion of
// that path has already been escaped and only process the package portion.
Unescape delimiters in the given path to give clients the 'real' path
when extracting paths from the packaged part of a package-relative path.

If path is a package-relative path, we assume the packaged portion of
that path has already been escaped and only process the package portion.
Unescape delimiters in the given path to give clients the ' real ' path when extracting paths from the packaged part of a package - relative path . If path is a package - relative path we assume the packaged portion of that path has already been escaped and only process the package portion .
pub(crate) fn unescape_delimiters(path: &str) -> String {
    if path.is_empty() {
        return path.to_string();
    }
    let escape_range_begin = 0;
    let escape_range_end = if path.ends_with(']') {
        path.len()
    } else if let Some(outer_open_index) = find_matching_opening_delimiter(path, path.len() - 1) {
        outer_open_index
    } else {
        path.len()
    };
    let escaped_string = &path[escape_range_begin..escape_range_end];
    let escaped_string = escaped_string.replace("\\[", "[");
    let escaped_string = escaped_string.replace("\\]", "]");
    escaped_string + &path[escape_range_end..path.len()]
}
pub ( crate ) fn unescape_delimiters ( path : & str ) -> String { if path . is_empty ( ) { return path . to_string ( ) ; } let escape_range_begin = 0 ; let escape_range_end = if path . ends_with ( ']' ) { path . len ( ) } else if let Some ( outer_open_index ) = find_matching_opening_delimiter ( path , path . len ( ) - 1 ) { outer_open_index } else { path . len ( ) } ; let escaped_string = & path [ escape_range_begin .. escape_range_end ] ; let escaped_string = escaped_string . replace ( " \\ " , " " ) ; let escaped_string = escaped_string . replace ( " \\ " , " " ) ; escaped_string + & path [ escape_range_end .. path . len ( ) ] }
Unescape delimiters in the given path to give clients the 'real' path
when extracting paths from the packaged part of a package-relative path.
Unescape delimiters in the given path to give clients the ' real ' path when extracting paths from the packaged part of a package - relative path .
path
&str