diff --git a/CHANGELOG.md b/CHANGELOG.md index 86f8ee17a..49ef92564 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -267,4 +267,11 @@ ### Changed - Eliminated a custom `AtomicU64` type by replacing it with `OnceLock` in the only place it's used. - - `FileOptions` now has the subtype `SimpleFileOptions` which implements `Copy` but has no extra data. \ No newline at end of file + - `FileOptions` now has the subtype `SimpleFileOptions` which implements `Copy` but has no extra data. + +## [1.1.1] + +### Added + + - `contains_file_named`: check whether a file entry exists in a zip file, without initializing the + metadata or needing to mutably borrow the `ZipArchive`. \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index c700230e3..c7b598066 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zip" -version = "1.1.0" +version = "1.1.1" authors = [ "Mathijs van de Nes ", "Marli Frost ", diff --git a/README.md b/README.md index 9c7b500c5..90856b52a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ zip [![Build Status](https://github.com/Pr0methean/zip-next/actions/workflows/ci.yaml/badge.svg)](https://github.com/Pr0methean/zip-next/actions?query=branch%3Amaster+workflow%3ACI) [![Crates.io version](https://img.shields.io/crates/v/zip.svg)](https://crates.io/crates/zip) -[Documentation](https://docs.rs/zip/1.1.0/zip/) +[Documentation](https://docs.rs/zip/latest/zip/) Info ---- @@ -33,14 +33,14 @@ With all default features: ```toml [dependencies] -zip = "1.1.0" +zip = "1.1.1" ``` Without the default features: ```toml [dependencies] -zip = { version = "1.1.0", default-features = false } +zip = { version = "1.1.1", default-features = false } ``` The features available are: @@ -53,7 +53,8 @@ The features available are: This is the fastest `deflate` implementation available. * `deflate-zopfli`: Enables deflating files with the `zopfli` library (used when compression quality is 10..=264). This is the most effective `deflate` implementation available. -* `deflate64`: Enables the deflate64 compression algorithm. Decompression is only supported. +* `deflate64`: Enables the deflate64 compression algorithm. Only decompression is supported. +* `lzma`: Enables the LZMA compression algorithm. Only decompression is supported. * `bzip2`: Enables the BZip2 compression algorithm. * `time`: Enables features using the [time](https://github.com/rust-lang-deprecated/time) crate. * `chrono`: Enables converting last-modified `zip::DateTime` to and from `chrono::NaiveDateTime`. diff --git a/src/lib.rs b/src/lib.rs index 243c20fa6..0a7276ef7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,6 +53,6 @@ mod zipcrypto; /// /// ```toml /// [dependencies] -/// zip = "=1.1.0" +/// zip = "=1.1.1" /// ``` pub mod unstable; diff --git a/src/read.rs b/src/read.rs index e8289c03a..3e7c026bc 100644 --- a/src/read.rs +++ b/src/read.rs @@ -650,6 +650,11 @@ impl ZipArchive { pub fn by_name(&mut self, name: &str) -> ZipResult { self.by_name_with_optional_password(name, None) } + + /// Check for a file entry, but do not decrypt it or initialize metadata. + pub fn contains_file_named(&self, name: &str) -> bool { + self.shared.names_map.contains_key(name) + } fn by_name_with_optional_password<'a>( &'a mut self,