Contextualize error into result instead of error
This commit is contained in:
@@ -245,10 +245,10 @@ impl<T> Contextualize<Result<T, Error>> for Option<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Into<Error>> Contextualize<Error> for E {
|
||||
impl<T, E: Into<Error>> Contextualize<Result<T, Error>> for E {
|
||||
#[track_caller]
|
||||
fn err_context(self, context: impl Into<String>) -> Error {
|
||||
self.into().with_context(context)
|
||||
fn err_context(self, context: impl Into<String>) -> Result<T, Error> {
|
||||
Err(self.into().with_context(context))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user