You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.
I've been thinking of adding a .none_means(msg) (name bikeshed welcome) method to Option which expands .ok_or_else(|| err_msg(msg)). You can use it similar to .expect but returns an error instead of panicking.
I've implemented this in killercup/quicli#25 where you can also find a bit of discussion. If this is something you want to have upstream, i.e., in failure, let me know.
The text was updated successfully, but these errors were encountered:
Yeah, good point. There's no rush, I'm okay with landing this in quicli itself (once I have a concrete use case) and switching to exporting the upstream version later on.
Am 29.01.2018 um 10:41 schrieb boats ***@***.***>:
Seems like a useful method. Not really sure if anyone will import an OptionExt trait just for this method though. :-\
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
It makes sense to implement OptionExt (did it the other day, easy) and that the method be called context. Arguably, only saves a few keystrokes but the result looks much clearer.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've been thinking of adding a
.none_means(msg)
(name bikeshed welcome) method to Option which expands.ok_or_else(|| err_msg(msg))
. You can use it similar to.expect
but returns an error instead of panicking.I've implemented this in killercup/quicli#25 where you can also find a bit of discussion. If this is something you want to have upstream, i.e., in failure, let me know.
The text was updated successfully, but these errors were encountered: