From f2af8bb3e9939330c4fe3c26e4abaef48560c566 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Fri, 17 Nov 2023 12:55:24 +0800 Subject: [PATCH] clippy: change match to if let Signed-off-by: Soc Virnyl Estela --- cargo/src/vendor.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/cargo/src/vendor.rs b/cargo/src/vendor.rs index 54e32ae..8cf7a3e 100644 --- a/cargo/src/vendor.rs +++ b/cargo/src/vendor.rs @@ -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| {