fn is_new_file_path(path: &Path) -> bool {
    !path.exists()
        && (path.parent().map(Path::is_dir).unwrap_or(true)
            || path.parent().unwrap().to_string_lossy().is_empty()) // In case of a simple file
}
/// Test if the path is a new file path that can be
/// created immediately
Test if the path is a new file path that can be
created immediately
Test if the path is a new file path that can be created immediately
fn is_new_file_path(path: &Path) -> bool {
    !path.exists()
        && (path.parent().map(Path::is_dir).unwrap_or(true)
            || path.parent().unwrap().to_string_lossy().is_empty()) // In case of a simple file
}
fn is_new_file_path ( path : & Path ) -> bool { ! path . exists ( ) && ( path . parent ( ) . map ( Path :: is_dir ) . unwrap_or ( true ) || path . parent ( ) . unwrap ( ) . to_string_lossy ( ) . is_empty ( ) ) // In case of a simple file }
Test if the path is a new file path that can be
created immediately
Test if the path is a new file path that can be created immediately
path
&Path
path
&Path