array::try_map
tracking issue: #79711Iterator::try_find
tracking issue: #63178
try_map
only allows the closure to return a Result
, and has the function also return a Result
.try_find
was added in #63177 allowing the closure to return any Try
(v1), but the function itself always returned a Result
.
With Try
v2, there's no longer an associated type for the Error
type, so try_find
needs a different approach. #84767 changed it to a bit of a hacky version that's probably not what should be stabilized. And whatever solution is picked should probably be used for try_map
as well.
I think there are two main options:
Result
. This is certainly the easiest option. It's unclear how important supporting other types would be -- this might depend on the error handling WG's work. If it ends up having a not-really-Result
type that's used in some situations, this might be suboptimal..try_find(...)?
wouldn't work, as ?
isn't a strong enough context to force any particular family of types.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4