Contextualize error into result instead of error

This commit is contained in:
2026-06-21 13:51:12 -04:00
parent d16a66a2f5
commit f159e12400

View File

@@ -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))
} }
} }