Skip to content

Commit

Permalink
Add From<ChunkKeyEncodingTraits> for ChunkKeyEncoding
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Dec 21, 2023
1 parent 2d7c1c3 commit 62857ba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Add `From<ChunkKeyEncodingTraits>` for `ChunkKeyEncoding`

## [0.7.2] - 2023-12-17

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zarrs"
version = "0.7.2"
version = "0.7.3"
authors = ["Lachlan Deakin <[email protected]>"]
edition = "2021"
rust-version = "1.70"
Expand Down
9 changes: 9 additions & 0 deletions src/array/chunk_key_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ impl ChunkKeyEncoding {
}
}

impl<T> From<T> for ChunkKeyEncoding
where
T: ChunkKeyEncodingTraits + 'static,
{
fn from(chunk_key_encoding: T) -> Self {
ChunkKeyEncoding::new(chunk_key_encoding)
}
}

/// Chunk key encoding traits.
pub trait ChunkKeyEncodingTraits: dyn_clone::DynClone + core::fmt::Debug + Send + Sync {
/// Create the metadata of this chunk key encoding.
Expand Down

0 comments on commit 62857ba

Please sign in to comment.