Skip to content

Commit

Permalink
Make zip a private dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Jan 23, 2024
1 parent 5ea7d95 commit 825ff90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Array methods now have `<T: bytemuck::Pod + ..>` instead of `<T: safe_transmute::TriviallyTransmutable + ..>`
- **Breaking**: Rename `array::safe_transmute_to_bytes_vec` to `array::transmute_to_bytes_vec`
- **Breaking**: Make `zfp` a private dependency by changing `Zfp{Bitstream,Field,Stream}` from `pub` to `pub(super)`
- **Breaking**: Make `zip` a private dependency by not exposing `ZipError` in `ZipStorageAdapterCreateError`

### Removed
- **Breaking**: Remove `StorePrefixError::new`, deprecated since `v0.7.3`
Expand Down
9 changes: 6 additions & 3 deletions src/storage/storage_adapter/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ impl<TStorage: ?Sized + ReadableStorageTraits> ZipStorageAdapter<TStorage> {
StorageError::UnknownKeySize(key.clone()).into(),
)?;
let storage_io = StorageValueIO::new(storage, key, size);
let zip_archive = Mutex::new(ZipArchive::new(storage_io)?);
let zip_archive = Mutex::new(
ZipArchive::new(storage_io)
.map_err(|err| ZipStorageAdapterCreateError::ZipError(err.to_string()))?,
);
Ok(Self {
size,
zip_archive,
Expand Down Expand Up @@ -228,8 +231,8 @@ pub enum ZipStorageAdapterCreateError {
#[error("{0} is an existing directory, not a zip file")]
ExistingDir(PathBuf),
/// A zip error.
#[error(transparent)]
ZipError(#[from] ZipError),
#[error("{0}")]
ZipError(String),
/// A storage error.
#[error(transparent)]
StorageError(#[from] StorageError),
Expand Down

0 comments on commit 825ff90

Please sign in to comment.