Skip to content

Commit

Permalink
add get_entries getter
Browse files Browse the repository at this point in the history
  • Loading branch information
rfuzzo committed Oct 10, 2024
1 parent b580161 commit 73e3c29
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 33 deletions.
64 changes: 32 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/archive/file_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub(crate) struct FileEntry {
}

impl FileEntry {
#[allow(clippy::too_many_arguments)]
pub(crate) fn new(
name_hash_64: u64,
timestamp: u64,
Expand Down
5 changes: 5 additions & 0 deletions src/archive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,10 @@ impl<S> ZipArchive<S> {
pub fn get_entry_by_hash(&self, hash: &u64) -> Option<&ZipEntry> {
self.entries.get(hash)
}

pub fn get_entries(&self) -> &HashMap<u64, ZipEntry> {
&self.entries
}
}

impl<R> ZipArchive<R>
Expand Down Expand Up @@ -807,6 +811,7 @@ where
}

impl<W: Write + Seek> ZipArchive<W> {
#[allow(dead_code)] // TODO: Implement
fn write(&mut self) {
todo!()
}
Expand Down
2 changes: 1 addition & 1 deletion src/kraken.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn decompress(compressed_buffer: Vec<u8>, output_buffer: &mut Vec<u8>, size:

/// Compresses a buffer into another
pub fn compress(
uncompressed_buffer: &Vec<u8>,
#[allow(clippy::ptr_arg)] uncompressed_buffer: &Vec<u8>,
compressed_buffer: &mut Vec<u8>,
compression_level: CompressionLevel,
) -> i32 {
Expand Down

0 comments on commit 73e3c29

Please sign in to comment.