File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ anyhow = {version = "1.0.66"}
3434clap = {version = " ~3.2.8" , features = [" derive" ]}
3535serde = {version = " 1.0.118" , features = [" derive" ]}
3636serde-pickle = " 1.1.0"
37+ serde_json = {version = " 1.0.67" }
3738bincode = " 1.3.1"
3839rand = " 0.8.3"
3940rand_distr = " 0.4.0"
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ pub struct NodeDefaults {
282282///
283283/// See [the book](https://tskit-dev.github.io/tskit-rust/)
284284/// for details.
285- #[ derive( Debug , Clone ) ]
285+ #[ derive( Debug , Clone , Default ) ]
286286pub struct NodeDefaultsWithMetadata < M >
287287where
288288 M : crate :: metadata:: NodeMetadata ,
@@ -362,6 +362,12 @@ where
362362/// value: i32,
363363/// }
364364///
365+ /// impl Default for NodeMetadata {
366+ /// fn default() -> Self {
367+ /// Self{value: 0}
368+ /// }
369+ /// }
370+ ///
365371/// impl tskit::metadata::MetadataRoundtrip for NodeMetadata {
366372/// fn encode(&self) -> Result<Vec<u8>, tskit::metadata::MetadataError> {
367373/// match serde_json::to_string(self) {
@@ -398,6 +404,12 @@ where
398404/// value: i32,
399405/// }
400406///
407+ /// impl Default for NodeMetadata {
408+ /// fn default() -> Self {
409+ /// Self{value: 0}
410+ /// }
411+ /// }
412+ ///
401413/// impl tskit::metadata::MetadataRoundtrip for NodeMetadata {
402414/// fn encode(&self) -> Result<Vec<u8>, tskit::metadata::MetadataError> {
403415/// match serde_json::to_string(self) {
You can’t perform that action at this time.
0 commit comments