From 3ac62a2177df7bc1a3ea0708bf0de5d968e59f34 Mon Sep 17 00:00:00 2001 From: ph0llux Date: Thu, 7 Dec 2023 07:48:30 +0100 Subject: [PATCH] Removed clippy warnings for windows targets --- src/lib/io/mod.rs | 6 +++--- src/lib/object/encoder.rs | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/io/mod.rs b/src/lib/io/mod.rs index cca2dd6..c5226bd 100644 --- a/src/lib/io/mod.rs +++ b/src/lib/io/mod.rs @@ -391,16 +391,16 @@ fn add_to_hardlink_map(hardlink_map: &mut HashMap>, metad let volume_serial_number = metadata.volume_serial_number().unwrap() as u64; match hardlink_map.get_mut(&volume_serial_number) { Some(inner_map) => match inner_map.get_mut(&file_index) { - Some(fno) => return Some(*fno), + Some(fno) => Some(*fno), None => { inner_map.insert(file_index, filenumber); - return None + None }, }, None => { hardlink_map.insert(volume_serial_number, HashMap::new()); hardlink_map.get_mut(&volume_serial_number).unwrap().insert(file_index, filenumber); - return None; + None }, } } diff --git a/src/lib/object/encoder.rs b/src/lib/object/encoder.rs index 20e64f8..c590950 100644 --- a/src/lib/object/encoder.rs +++ b/src/lib/object/encoder.rs @@ -417,6 +417,7 @@ impl LogicalObjectEncoder { None => return Err(ZffError::new(ZffErrorKind::NoFilesLeft, "There is no input file")) }; //open first file path - if the path is not accessable, create an empty reader. + #[cfg_attr(target_os = "windows", allow(clippy::needless_borrows_for_generic_args))] let reader = match File::open(&path) { Ok(reader) => Box::new(reader), Err(_) => create_empty_reader() @@ -594,6 +595,7 @@ impl LogicalObjectEncoder { } }; + #[cfg_attr(target_os = "windows", allow(clippy::needless_borrows_for_generic_args))] let reader = match File::open(&path) { Ok(reader) => Box::new(reader), Err(_) => create_empty_reader()