Want to build a tool to document papercuts. I think there's a lot of value to be had in documenting the small speedbumps you experience, at the time you experience them. Think the optimization path from "good" to "excellent" often lies in figuring out where the papercuts are.
Ahhhh, yes okay - that looks a lot closer! Looks like it only applies to Result types though, not Option types. So still don't think it would solve this case. But it's getting closer!
-
-
Option has or_else which you can return another Option from, and `ok_or_else(fn)` which turns an Option<T> into a Result<T, E> in a similar way https://doc.rust-lang.org/std/option/enum.Option.html#method.ok_or_else …
-
Yeah, but I'm still not seeing any way where we can handle errors inside the None branch. How would the initial example be expressed with these statements? I feel like I'm missing something obvious?
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.