Skip to content

Commit 9f1c816

Browse files
committed
feat: impl From<Node> for NodeMetadata
1 parent 4a9d77c commit 9f1c816

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111
- Add `Node::[async_]get_direct_child_nodes`
12+
- Impl `From<Node>` for `NodeMetadata`
1213

1314
### Changed
1415
- Reduce metadata code duplication in the `Node` module

zarrs/src/node.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ pub struct Node {
6161
children: Vec<Node>,
6262
}
6363

64+
impl From<Node> for NodeMetadata {
65+
fn from(value: Node) -> Self {
66+
value.metadata
67+
}
68+
}
69+
6470
/// A node creation error.
6571
#[derive(Debug, Error)]
6672
pub enum NodeCreateError {

0 commit comments

Comments
 (0)