fn windows_path_escape(path: &Path) -> std::result::Result<String, Box<dyn std::error::Error>> {
    let path = path.to_str().ok_or(PathError)?;

    // TODO: actually escape the path
    // For now we just forbid suspicious strings.
    if path
        .find(|c| matches!(c, '\"' | '\'' | '^') || c.is_control())
        .is_some()
        || path.ends_with('\\')
    {
        return Err(PathError.into());
    }

    Ok(path.to_owned())
}
// Encode path string for Windows command line argument
Encode path string for Windows command line argument
Encode path string for Windows command line argument
fn windows_path_escape(path: &Path) -> std::result::Result<String, Box<dyn std::error::Error>> {
    let path = path.to_str().ok_or(PathError)?;
    // TODO: actually escape the path
    // For now we just forbid suspicious strings.
    if path
        .find(|c| matches!(c, '\"' | '\'' | '^') || c.is_control())
        .is_some()
        || path.ends_with('\\')
    {
        return Err(PathError.into());
    }
    Ok(path.to_owned())
}
fn windows_path_escape ( path : & Path ) -> std :: result :: Result < String , Box < dyn std :: error :: Error > > { let path = path . to_str ( ) . ok_or ( PathError ) ? ; // TODO: actually escape the path // For now we just forbid suspicious strings. if path . find ( | c | matches ! ( c '\"' '\'' '^' ) || c . is_control ( ) ) . is_some ( ) || path . ends_with ( '\\' ) { return Err ( PathError . into ( ) ) ; } Ok ( path . to_owned ( ) ) }
Encode path string for Windows command line argument
Encode path string for Windows command line argument
path
&Path