Created
December 23, 2014 05:11
-
-
Save reissbaker/a4701e180d6e4526d2b1 to your computer and use it in GitHub Desktop.
match vs and_then
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
io_result.and_then(|result| { | |
// do something | |
}).ok(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match io_result { | |
Ok(result) => { | |
// do something | |
}, | |
_ => () | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment