@@ -189,15 +189,15 @@ pub(super) fn parse_7z(path: &Path) -> Result<ParsedDocument> {
189189 ) ;
190190 } ;
191191
192- let entries = list_7z_entries ( & binary, path) ?;
192+ let entries = list_7z_entries ( binary, path) ?;
193193 let entry_count = entries. len ( ) ;
194194 let mut extracted = Vec :: new ( ) ;
195195 for name in entries {
196196 let lower = name. to_ascii_lowercase ( ) ;
197197 if !is_archive_entry_candidate ( & lower) {
198198 continue ;
199199 }
200- let bytes = extract_7z_entry ( & binary, path, & name) ?;
200+ let bytes = extract_7z_entry ( binary, path, & name) ?;
201201 extracted. push ( ( name, bytes) ) ;
202202 }
203203
@@ -599,15 +599,15 @@ fn parse_7z_bytes(name: &str, bytes: Vec<u8>, depth: usize) -> Result<ParsedDocu
599599 anyhow:: bail!( "no 7z/7zz/7za binary found on PATH" ) ;
600600 } ;
601601
602- let entries = list_7z_entries ( & binary, & path) ?;
602+ let entries = list_7z_entries ( binary, & path) ?;
603603 let entry_count = entries. len ( ) ;
604604 let mut extracted = Vec :: new ( ) ;
605605 for entry_name in entries {
606606 let lower = entry_name. to_ascii_lowercase ( ) ;
607607 if !is_archive_entry_candidate ( & lower) {
608608 continue ;
609609 }
610- let bytes = extract_7z_entry ( & binary, & path, & entry_name) ?;
610+ let bytes = extract_7z_entry ( binary, & path, & entry_name) ?;
611611 extracted. push ( ( entry_name, bytes) ) ;
612612 }
613613
@@ -745,7 +745,7 @@ fn decode_text_bytes(bytes: &[u8]) -> Result<String> {
745745 return Ok ( text. to_string ( ) ) ;
746746 }
747747
748- if bytes. len ( ) >= 2 && bytes. len ( ) % 2 == 0 {
748+ if bytes. len ( ) >= 2 && bytes. len ( ) . is_multiple_of ( 2 ) {
749749 let utf16: Vec < u16 > = bytes
750750 . chunks_exact ( 2 )
751751 . map ( |chunk| u16:: from_le_bytes ( [ chunk[ 0 ] , chunk[ 1 ] ] ) )
0 commit comments