Skip to content

Commit

Permalink
Merge branch 'main' into rayon
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTheCoolingFan committed May 3, 2024
2 parents 9700c22 + 905fe0f commit c0d2d97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/zip_archive_parts/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ impl ZipData {
}

#[inline]
pub fn files_amount_u16(&self) -> u16 {
fn files_amount_u16(&self) -> u16 {
let amount = self.files.len();
debug_assert!(amount <= u16::MAX as usize);
amount as u16
}

#[inline]
pub fn write_files_contained_and_iter<W: Write + Seek, I: IntoIterator<Item = ZipFile>>(
fn write_files_contained_and_iter<W: Write + Seek, I: IntoIterator<Item = ZipFile>>(
&mut self,
buf: &mut W,
zip_files_iter: I,
Expand Down Expand Up @@ -90,6 +90,7 @@ impl ZipData {
.collect::<std::io::Result<Vec<_>>>()
}

#[cfg(feature = "rayon")]
pub fn write_files_par_iter<W: Write + Seek + Send, I: ParallelIterator<Item = ZipFile>>(
&mut self,
buf: &mut W,
Expand All @@ -104,7 +105,7 @@ impl ZipData {
.collect::<std::io::Result<Vec<_>>>()
}

pub fn write_central_dir<W: Write, I: IntoIterator<Item = ZipFileNoData>>(
fn write_central_dir<W: Write, I: IntoIterator<Item = ZipFileNoData>>(
&self,
zip_files: I,
buf: &mut W,
Expand All @@ -116,7 +117,7 @@ impl ZipData {

const FOOTER_LENGTH: usize = 22;

pub fn write_end_of_central_directory<W: Write>(
fn write_end_of_central_directory<W: Write>(
&self,
buf: &mut W,
central_dir_offset: u32,
Expand Down

0 comments on commit c0d2d97

Please sign in to comment.