///
/// Function for creating a directory and just bail in case it already exists.
/// If there is an error here this code will panic as these directories are required in order for
/// this program to work correctly.
///
Function for creating a directory and just bail in case it already exists.
If there is an error here this code will panic as these directories are required in order for
this program to work correctly.
Function for creating a directory and just bail in case it already exists . If there is an error here this code will panic as these directories are required in order for this program to work correctly .
fn create_dir(path: &str) {
    // dir already existits so just bail
    if let Ok(p) = fs::metadata(path) {
        if p.is_dir() {
            return;
        }
    }
    // This function is expected to succed now when we have checked that the directory exists
    fs::create_dir(path).unwrap();
}
fn create_dir ( path : & str ) { // dir already existits so just bail if let Ok ( p ) = fs :: metadata ( path ) { if p . is_dir ( ) { return ; } } // This function is expected to succed now when we have checked that the directory exists fs :: create_dir ( path ) . unwrap ( ) ; }
Function for creating a directory and just bail in case it already exists.
Function for creating a directory and just bail in case it already exists .
path
&str