This commit is contained in:
2022-06-13 23:49:10 +00:00
committed by GitHub
parent aff743e1f2
commit be15a388ca
3 changed files with 87 additions and 119 deletions

View File

@@ -27,3 +27,12 @@ impl<T, E> TryErr<T, E> for Option<T> {
}
}
}
impl<T, E, E2> TryErr<T, E> for Result<T, E2> {
fn try_err(self, err: E) -> Result<T, E> {
match self {
Ok(v) => { Ok(v) }
Err(_) => { Err(err) }
}
}
}