Skip to content

Commit 9f54cb1

Browse files
authored
fix: MetadataError::RoundtripError now requires Send + Sync (#396)
* add anyhow to dev dependencies BREAKING CHANGE: error types not Send + Sync are now incompatible with metadata round trips.
1 parent dbece4f commit 9f54cb1

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ tskit-derive = {version = "0.2.0", path = "tskit-derive", optional = true}
2929
mbox = "0.6.0"
3030

3131
[dev-dependencies]
32+
anyhow = {version = "1.0.66"}
3233
clap = {version = "~3.2.8", features = ["derive"]}
3334
serde = {version = "1.0.118", features = ["derive"]}
3435
serde-pickle = "1.1.0"

src/error.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,14 @@ mod test {
142142
panic!();
143143
}
144144
}
145+
146+
#[test]
147+
fn test_anyhow_compatability() {
148+
fn foo() -> anyhow::Result<crate::TableCollection> {
149+
let tables = crate::TableCollection::new(1.0)?;
150+
Ok(tables)
151+
}
152+
153+
let _ = foo().unwrap();
154+
}
145155
}

src/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub enum MetadataError {
246246
#[error("{}", *value)]
247247
RoundtripError {
248248
#[from]
249-
value: Box<dyn std::error::Error>,
249+
value: Box<dyn std::error::Error + Send + Sync>,
250250
},
251251
}
252252

0 commit comments

Comments
 (0)