style: cargo fmt --all
This commit is contained in:
parent
d309f07010
commit
a895aa57b1
1 changed files with 35 additions and 31 deletions
66
src/read.rs
66
src/read.rs
|
@ -677,38 +677,42 @@ impl<R: Read + Seek> ZipArchive<R> {
|
||||||
let mut unsupported_errors = Vec::new();
|
let mut unsupported_errors = Vec::new();
|
||||||
let mut ok_results = Vec::new();
|
let mut ok_results = Vec::new();
|
||||||
let cde_locations = spec::Zip32CentralDirectoryEnd::find_and_parse(reader)?;
|
let cde_locations = spec::Zip32CentralDirectoryEnd::find_and_parse(reader)?;
|
||||||
cde_locations.into_vec().into_iter().for_each(|(footer, cde_start_pos)| {
|
cde_locations
|
||||||
let zip32_result =
|
.into_vec()
|
||||||
Self::get_directory_info_zip32(&config, reader, &footer, cde_start_pos);
|
.into_iter()
|
||||||
Self::sort_result(
|
.for_each(|(footer, cde_start_pos)| {
|
||||||
zip32_result.and_then(|result| Self::read_central_header(result, config, reader)),
|
let zip32_result =
|
||||||
&mut invalid_errors,
|
Self::get_directory_info_zip32(&config, reader, &footer, cde_start_pos);
|
||||||
&mut unsupported_errors,
|
Self::sort_result(
|
||||||
&mut ok_results,
|
zip32_result
|
||||||
&footer,
|
.and_then(|result| Self::read_central_header(result, config, reader)),
|
||||||
);
|
&mut invalid_errors,
|
||||||
// Check if file has a zip64 footer
|
&mut unsupported_errors,
|
||||||
if let Ok(zip64_footers) =
|
&mut ok_results,
|
||||||
Self::get_directory_info_zip64(&config, reader, &footer, cde_start_pos)
|
&footer,
|
||||||
{
|
);
|
||||||
zip64_footers
|
// Check if file has a zip64 footer
|
||||||
.into_iter()
|
if let Ok(zip64_footers) =
|
||||||
.map(|result| {
|
Self::get_directory_info_zip64(&config, reader, &footer, cde_start_pos)
|
||||||
result.and_then(|dir_info| {
|
{
|
||||||
Self::read_central_header(dir_info, config, reader)
|
zip64_footers
|
||||||
|
.into_iter()
|
||||||
|
.map(|result| {
|
||||||
|
result.and_then(|dir_info| {
|
||||||
|
Self::read_central_header(dir_info, config, reader)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
.for_each(|result| {
|
||||||
.for_each(|result| {
|
Self::sort_result(
|
||||||
Self::sort_result(
|
result,
|
||||||
result,
|
&mut invalid_errors,
|
||||||
&mut invalid_errors,
|
&mut unsupported_errors,
|
||||||
&mut unsupported_errors,
|
&mut ok_results,
|
||||||
&mut ok_results,
|
&footer,
|
||||||
&footer,
|
)
|
||||||
)
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
if ok_results.is_empty() {
|
if ok_results.is_empty() {
|
||||||
return Err(unsupported_errors
|
return Err(unsupported_errors
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
Loading…
Add table
Reference in a new issue