fn create_parent_dir(path: &Path) -> std::io::Result<()> {
    let parent = path.parent().unwrap_or_else(|| Path::new(""));
    if !parent.is_dir() && parent != Path::new("") {
        std::fs::create_dir(parent)
    } else {
        Ok(())
    }
}
/// Create parent directory of path, if it doesn't exist.
Create parent directory of path, if it doesn't exist.
Create parent directory of path if it doesn ' t exist .
fn create_parent_dir(path: &Path) -> std::io::Result<()> {
    let parent = path.parent().unwrap_or_else(|| Path::new(""));
    if !parent.is_dir() && parent != Path::new("") {
        std::fs::create_dir(parent)
    } else {
        Ok(())
    }
}
fn create_parent_dir ( path : & Path ) -> std :: io :: Result < ( ) > { let parent = path . parent ( ) . unwrap_or_else ( | | Path :: new ( " " ) ) ; if ! parent . is_dir ( ) && parent != Path :: new ( " " ) { std :: fs :: create_dir ( parent ) } else { Ok ( ( ) ) } }
Create parent directory of path, if it doesn't exist.
Create parent directory of path if it doesn ' t exist .
path
&Path
path
&Path