From 9ee18da1ccb8b26ed44c3f94d335602b6338fee0 Mon Sep 17 00:00:00 2001 From: Wiktor Kwapisiewicz Date: Mon, 16 Jan 2023 09:35:04 +0100 Subject: [PATCH] Rename ErrorWithStacktrace to TestError Signed-off-by: Wiktor Kwapisiewicz --- src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1909002..06d3981 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,9 +10,9 @@ /// This type is useful only in the result of unit tests and cannot be instantiated. #[derive(Debug)] #[doc(hidden)] -pub enum ErrorWithStacktrace {} +pub enum TestError {} -impl From for ErrorWithStacktrace { +impl From for TestError { #[track_caller] // Will show the location of the caller in test failure messages fn from(error: T) -> Self { panic!("error: {} - {}", std::any::type_name::(), error); @@ -39,8 +39,7 @@ impl From for ErrorWithStacktrace { /// Ok(()) /// } /// ``` - -pub type TestResult = std::result::Result<(), ErrorWithStacktrace>; +pub type TestResult = std::result::Result<(), TestError>; #[cfg(test)] mod tests {