diff --git a/src/handler.rs b/src/handler.rs index a6a7eadb8..cafb90867 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -245,8 +245,8 @@ impl Reply { } #[cfg(test)] - pub(crate) fn as_msg(&self) -> &T { - match self.0 { + pub(crate) fn as_msg(&self) -> &I { + match self.0.as_ref().unwrap() { ReplyResult::Ok(ref resp) => resp, _ => panic!(), } @@ -254,7 +254,7 @@ impl Reply { #[cfg(test)] pub(crate) fn as_err(&self) -> Option<&E> { - match self.0 { + match self.0.as_ref().unwrap() { ReplyResult::Err(ref err) => Some(err), _ => None, }