We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
try_from_fn
This is just from_fn that takes a function that returns Result<T, E> instead of T.
from_fn
Result<T, E>
T
This means that when we have
StaticMap::from_fn(|v| foo(v))
and now foo becomes a Result, we could do
foo
StaticMap::try_from_fn(|v| foo(v))?
For now the most ergonomic thing is
static_map! { v => foo(v)? }
which works but has all the usual annoyances of using a macro such as formatting problems.
One can't even go via array and try_map from stdlib and rewrap as it's still experimental.
Original ticket in enum-map: https://codeberg.org/xfix/enum-map/issues/148
The text was updated successfully, but these errors were encountered:
I guess it'd use rust-lang/rust#84277 once that's stable.
Sorry, something went wrong.
No branches or pull requests
This is just
from_fn
that takes a function that returnsResult<T, E>
instead ofT
.This means that when we have
and now
foo
becomes a Result, we could doFor now the most ergonomic thing is
which works but has all the usual annoyances of using a macro such as formatting problems.
One can't even go via array and try_map from stdlib and rewrap as it's still experimental.
Original ticket in enum-map: https://codeberg.org/xfix/enum-map/issues/148
The text was updated successfully, but these errors were encountered: