Skip to content

Commit 10f2718

Browse files
committed
the private doctest now failes to compile for the right reason
1 parent 2e9d139 commit 10f2718

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ anyhow = {version = "1.0.66"}
3434
clap = {version = "~3.2.8", features = ["derive"]}
3535
serde = {version = "1.0.118", features = ["derive"]}
3636
serde-pickle = "1.1.0"
37+
serde_json = {version = "1.0.67"}
3738
bincode = "1.3.1"
3839
rand = "0.8.3"
3940
rand_distr = "0.4.0"

src/node_table.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff 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)]
286286
pub struct NodeDefaultsWithMetadata<M>
287287
where
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) {

0 commit comments

Comments
 (0)