Skip to content

Commit

Permalink
clippy: change match to if let
Browse files Browse the repository at this point in the history
Signed-off-by: Soc Virnyl Estela <[email protected]>
  • Loading branch information
uncomfyhalomacro committed Nov 17, 2023
1 parent 9609059 commit f2af8bb
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions cargo/src/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,14 @@ pub fn vendor(
)
})?;

match cargo_config.as_ref().parent() {
Some(p_path) => {
fs::create_dir_all(p_path).map_err(|err| {
error!(?err, "Failed to create parent dir for cargo config");
OBSCargoError::new(
OBSCargoErrorKind::VendorError,
"failed to create parent dir for cargo config".to_string(),
)
})?;
}
_ => {}
if let Some(p_path) = cargo_config.as_ref().parent() {
fs::create_dir_all(p_path).map_err(|err| {
error!(?err, "Failed to create parent dir for cargo config");
OBSCargoError::new(
OBSCargoErrorKind::VendorError,
"failed to create parent dir for cargo config".to_string(),
)
})?;
}

let mut file_cargo_config = fs::File::create(cargo_config.as_ref()).map_err(|err| {
Expand Down

0 comments on commit f2af8bb

Please sign in to comment.