Skip to content

Commit

Permalink
style: cargo fmt --all
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean committed May 23, 2024
1 parent 7d61377 commit da8be86
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,9 @@ impl<A: Read + Write + Seek> ZipWriter<A> {
let mut options = FileOptions::<ExtendedFileOptions> {
compression_method: src_data.compression_method,
compression_level: src_data.compression_level,
last_modified_time: src_data.last_modified_time.unwrap_or_else(DateTime::default_for_write),
last_modified_time: src_data
.last_modified_time
.unwrap_or_else(DateTime::default_for_write),
permissions: src_data.unix_mode(),
large_file: src_data.large_file,
encrypt_with: None,
Expand All @@ -594,7 +596,9 @@ impl<A: Read + Write + Seek> ZipWriter<A> {
let mut options = FileOptions::<()> {
compression_method: src_data.compression_method,
compression_level: src_data.compression_level,
last_modified_time: src_data.last_modified_time.unwrap_or_else(DateTime::default_for_write),
last_modified_time: src_data
.last_modified_time
.unwrap_or_else(DateTime::default_for_write),
permissions: src_data.unix_mode(),
large_file: src_data.large_file,
encrypt_with: None,
Expand Down Expand Up @@ -1194,7 +1198,10 @@ impl<W: Write + Seek> ZipWriter<W> {
{
let mut options = SimpleFileOptions::default()
.large_file(file.compressed_size().max(file.size()) > spec::ZIP64_BYTES_THR)
.last_modified_time(file.last_modified().unwrap_or_else(DateTime::default_for_write))
.last_modified_time(
file.last_modified()
.unwrap_or_else(DateTime::default_for_write),
)
.compression_method(file.compression());
if let Some(perms) = file.unix_mode() {
options = options.unix_permissions(perms);
Expand Down Expand Up @@ -1814,7 +1821,9 @@ fn write_central_directory_header<T: Write>(writer: &mut T, file: &ZipFileData)
// compression method
#[allow(deprecated)]
writer.write_u16_le(file.compression_method.to_u16())?;
let last_modified_time = file.last_modified_time.unwrap_or_else(DateTime::default_for_write);
let last_modified_time = file
.last_modified_time
.unwrap_or_else(DateTime::default_for_write);
// last mod file time + date
writer.write_u16_le(last_modified_time.timepart())?;
writer.write_u16_le(last_modified_time.datepart())?;
Expand Down

0 comments on commit da8be86

Please sign in to comment.