News for hackers. Stuff that matters.
Re:Effective Rust by csomar on Saturday June 17, 2023 @01:23PM (#36372253)
You can convert the Option to a Result where the None becomes the error and then propagate from that.

This is basically how you are using this Option by the way, and while it's possible, you have to consider why the original author decided to return an Option and not a Result: It's because he wants you to handle that in a way that doesn't fail (ie: an error) but instead consider it as a non-failure possibility.

There are no comments on this comment yet.