From b238404c6d82b0c65122e53c981cca47bb459ce7 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Tue, 31 Oct 2023 22:09:21 -0400 Subject: [PATCH] Review fixes part 2 --- libclamav_rust/src/onenote.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/libclamav_rust/src/onenote.rs b/libclamav_rust/src/onenote.rs index 01d49a130b..1b69105340 100644 --- a/libclamav_rust/src/onenote.rs +++ b/libclamav_rust/src/onenote.rs @@ -223,14 +223,7 @@ impl<'a> OneNote<'a> { self.remaining = remaining; - if let Some(file_data) = file_data { - Some(ExtractedFile { - name: None, - data: file_data, - }) - } else { - None - } + file_data.map(|data| ExtractedFile { data, name: None, }) } pub fn next_file_vec(&mut self) -> Option { @@ -266,14 +259,7 @@ impl<'a> OneNote<'a> { None }; - if let Some(file_data) = file_data { - Some(ExtractedFile { - name: None, - data: file_data, - }) - } else { - None - } + file_data.map(|data| ExtractedFile { data, name: None, }) } pub fn next_file_parser(&mut self) -> Option {