move pattern to fn argument
This commit is contained in:
parent
7c84e451d5
commit
a09c33e362
1 changed files with 1 additions and 2 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue