We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10f8ad5 commit df8b78fCopy full SHA for df8b78f
2 files changed
crates/libtest2-harness/src/error.rs
@@ -80,3 +80,12 @@ impl IntoRunResult for RunResult {
80
self
81
}
82
83
+
84
+impl<E> IntoRunResult for Result<(), E>
85
+where
86
+ E: std::error::Error + Send + Sync + 'static,
87
+{
88
+ fn into_run_result(self) -> RunResult {
89
+ self.map_err(RunError::with_cause)
90
+ }
91
+}
crates/libtest2/tests/testsuite/mixed_bag.rs
@@ -65,8 +65,8 @@ fn horse(context: &libtest2::TestContext) {
65
66
67
#[libtest2::test]
68
-fn custom_error(context: &libtest2::TestContext) -> libtest2::RunResult {
69
- Err(libtest2::RunError::from(std::io::Error::new(std::io::ErrorKind::Other, "I failed")))
+fn custom_error(context: &libtest2::TestContext) -> std::io::Result<()> {
+ Err(std::io::Error::new(std::io::ErrorKind::Other, "I failed"))
70
71
72
"#,
0 commit comments