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
Those suggested additions seem pretty reasonable. A semi-related issue was added here: #206
I do kind of worry that the amount of methods created by the derive will explode a bit, and thus impact compile time. So it might be nice to have some attributes to opt in/out of generating certain functions. Another option would be to make (some of) these separate derives.
I'd like to see more features from Rust's
Option
andResult
added to theUnwrap
derive.A few notable ones:
.map_<variant>(callback_function)
, a map that will only execute if theOption
orResult
variant is successful (Some
/None
)..expect_<variant>(error_msg)
, anunwrap
with a provided error message.unwrap_<variant>_or(fallback)
, andunwrap
that will return the fallback value if theOption
orResult
wereNone
orErr
The text was updated successfully, but these errors were encountered: