Skip to content

Commit

Permalink
add UnsupportedAdditionalFieldError::new
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Feb 12, 2025
1 parent aa5ad78 commit d48bbde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zarrs_metadata/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 `UnsupportedAdditionalFieldError::new`

### Fixed
- Make `AdditionalField` public and permit any JSON type (not just objects)

Expand Down
6 changes: 6 additions & 0 deletions zarrs_metadata/src/v3/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ pub struct UnsupportedAdditionalFieldError {
}

impl UnsupportedAdditionalFieldError {
/// Create a new [`UnsupportedAdditionalFieldError`].
#[must_use]
pub fn new(name: String, value: Value) -> UnsupportedAdditionalFieldError {
Self { name, value }
}

Check warning on line 232 in zarrs_metadata/src/v3/metadata.rs

View check run for this annotation

Codecov / codecov/patch

zarrs_metadata/src/v3/metadata.rs#L230-L232

Added lines #L230 - L232 were not covered by tests

/// Return the name of the unsupported additional field.
#[must_use]
pub fn name(&self) -> &str {
Expand Down

0 comments on commit d48bbde

Please sign in to comment.