Allow .or_http_err() to work with anyhow

This commit is contained in:
Damien Elmes 2023-02-18 15:27:36 +10:00
parent ff58c664d1
commit ce35ba123b

View File

@ -114,7 +114,7 @@ pub trait OrHttpErr {
impl<T, E> OrHttpErr for Result<T, E> impl<T, E> OrHttpErr for Result<T, E>
where where
E: std::error::Error + Send + Sync + 'static, E: Into<Box<dyn std::error::Error + Send + Sync + 'static>>,
{ {
type Value = T; type Value = T;
@ -127,7 +127,7 @@ where
HttpSnafu { HttpSnafu {
code, code,
context: context.into(), context: context.into(),
source: Some(Box::new(err) as _), source: err.into(),
} }
.build() .build()
}) })