Re:Thoughts on Rust, a few thousand lines in
by oleganza on Wednesday January 09, 2019 @06:47PM
(#18870219)
I'm using `.ok_or(SomeError)?` which converts Option into Result and opens Ok() for the rest of the scope, short-circuiting on Err(). I know about Swift's `guard` statement, but I never had a case yet when I didn't want to return Result in such kind of code, so ok_or was working for me well.
[ Parent
| on HN ]
There are no comments on this comment yet.