Skip to content

Commit

Permalink
style: Fix warning about operator precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean committed Jan 10, 2025
1 parent e074e09 commit 38bbd70
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,11 +807,12 @@ impl ZipFileData {
let last_modified_time = self
.last_modified_time
.unwrap_or_else(DateTime::default_for_write);
let version_to_extract = self.version_needed();
let version_made_by = (self.version_made_by as u16).max(version_to_extract);
Ok(ZipCentralEntryBlock {
magic: ZipCentralEntryBlock::MAGIC,
version_made_by: (self.system as u16) << 8
| (self.version_made_by as u16).max(self.version_needed()),
version_to_extract: self.version_needed(),
version_made_by: ((self.system as u16) << 8) | version_made_by,
version_to_extract,
flags: self.flags(),
compression_method: self.compression_method.serialize_to_u16(),
last_mod_time: last_modified_time.timepart(),
Expand Down

0 comments on commit 38bbd70

Please sign in to comment.