std::io::ErrorKind::NotFound=>{// attempt to create the missing directory
matchstd::fs::create_dir(basedir){
Ok(_)=>fs::read_dir(basedir).expect("could not read newly created directory"),// created patch directory successfully. return it to paths
Err(ee)=>panic!("Failed to create directory \"{}\".\n{:?}",basedir,ee),// we already know the path doesnt exist so no need to check for AlreadyExists error. panic
Err(ee)=>panic!("Failed to create directory \"{basedir}\".\n{ee:?}"),// we already know the path doesnt exist so no need to check for AlreadyExists error. panic
}
},
_=>panic!("Unable to read directory \"{}\".\n{:?}",basedir,e),
_=>panic!("Unable to read directory \"{basedir}\".\n{e:?}"),