Skip to content

Commit 92e6ce5

Browse files
committed
Make Result parametric in the error type as well
1 parent cb856f3 commit 92e6ce5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

googletest/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ use internal::test_outcome::{TestAssertionFailure, TestOutcome};
9191
/// of the (fatal) assertion failure which generated this result. Non-fatal
9292
/// assertion failures, which log the failure and report the test as having
9393
/// failed but allow it to continue running, are not encoded in this type.
94-
pub type Result<T> = std::result::Result<T, TestAssertionFailure>;
94+
pub type Result<T, E = TestAssertionFailure> = std::result::Result<T, E>;
9595

9696
/// Returns a [`Result`] corresponding to the outcome of the currently running
9797
/// test.

googletest_macro/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub fn gtest(
123123
};
124124

125125
let (output_type, result) = match sig.output {
126-
ReturnType::Default => (None, quote! {googletest::Result::Ok(())}),
126+
ReturnType::Default => (None, quote! {googletest::Result::<()>::Ok(())}),
127127
ReturnType::Type(_, ref ty) => (Some(quote! {#ty}), quote! {result}),
128128
};
129129

0 commit comments

Comments
 (0)