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 {