move pattern to fn argument

This commit is contained in:
Ralf Jung 2020-02-29 09:41:59 +01:00
parent 7c84e451d5
commit a09c33e362

View File

@ -943,8 +943,7 @@ pub trait MaybeResult<T> {
impl<T> MaybeResult<T> for T {
type Error = !;
fn from(x: Result<T, Self::Error>) -> Self {
let Ok(x) = x;
fn from(Ok(x): Result<T, Self::Error>) -> Self {
x
}
fn to_result(self) -> Result<T, Self::Error> {