mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
move pattern to fn argument
This commit is contained in:
parent
7c84e451d5
commit
a09c33e362
@ -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…
Reference in New Issue
Block a user