News for hackers. Stuff that matters.
Re:Thoughts on Rust, a few thousand lines in by steveklabnik on Wednesday January 09, 2019 @08:28PM (#18870747)
The question mark operator works via a trait, Try. Both Option and Result implement Try. If you use ? on a None value, it will return None, just like using ? on an Err returns an Err.

ok_or is a method on Option that would let you manually convert it to a Result. You could then combine it with ?, turning a None into a specific Err.

It won’t help for stuff that returns bool, it’s true.

Re:Thoughts on Rust, a few thousand lines in by vmarsy on Wednesday January 09, 2019 @08:33PM (#18870769)
Thanks for the detailed answer :)