Browse Source

based clippy in the cloud

andy/add-patch-log-dir
andy 1 year ago
parent
commit
178143a3bf
  1. 2
      src/bin/main.rs
  2. 4
      src/patch/patch.rs

2
src/bin/main.rs

@ -21,7 +21,7 @@ fn setup_logger() {
match e.kind() {
std::io::ErrorKind::AlreadyExists => {}, // false error
_ => { // real error
panic!("Failed to create \"log\" directory.\n{:?}", e);
panic!("Failed to create \"log\" directory.\n{e:?}");
},
}
},

4
src/patch/patch.rs

@ -225,10 +225,10 @@ fn load_patch_dir(basedir: &str, patchbase: &str, file_ids: &mut HashMap<u32, Pa
std::io::ErrorKind::NotFound => { // attempt to create the missing directory
match std::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:?}"),
}
},
}

Loading…
Cancel
Save