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]
|
#[track_caller]
|
||||||
fn err_context(self, context: impl Into<String>) -> Error {
|
fn err_context(self, context: impl Into<String>) -> Result<T, Error> {
|
||||||
self.into().with_context(context)
|
Err(self.into().with_context(context))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user