-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
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
Tracking issue for array::try_map
#79711
Comments
Not sure if this change is still active, but I've stumbled upon a use case where a broader version of this for iterators in general, rather than strictly for arrays, would be useful. Is that something worth considering? I'm totally new to both Rust contributions & open source in general, so I'm not sure if the idea of a general (And, if it gets to that point, I'd be interested in taking a stab at implementing it. Would love to make a contribution to Rust, no matter how small!) |
Make `array::{try_from_fn, try_map}` and `Iterator::try_find` generic over `Try` Fixes rust-lang#85115 This only updates unstable functions. `array::try_map` didn't actually exist before; this adds it under the still-open tracking issue rust-lang#79711 from the old PR rust-lang#79713. Tracking issue for the new trait: rust-lang#91285 This would also solve the return type question in for the proposed `Iterator::try_reduce` in rust-lang#87054
@arthurlafrance It'd suggest starting a conversation on This change is still open, but is for tracking this specific change, not a good place to discuss an additional possible API. |
+1 for this one, it's the only way I found to run a fallible
I guess that's what |
Is there anything blocking stabilization? |
Note that this, like See #94119 (comment) where |
I believe #91285 is the tracking issue for stabilizing |
Right, stabilizing |
Thank you for the replies! As far as I understood, there is a consensus that exposing |
In this case, is it possible to rewrite the current implementation to only use |
I don't think it's possible to rewrite with |
Feature gate:
#![feature(array_try_map)]
This is a tracking issue for
Public API
https://doc.rust-lang.org/nightly/std/primitive.array.html#method.try_map
Steps / History
array::try_map #79713Makearray::{try_from_fn, try_map}
andIterator::try_find
generic overTry
#91286Result
, vs potentially supportingOption
and otherTry
types Decide on generic-ness of functions likeIterator::try_find
andarray::try_map
#85115Unresolved Questions
The text was updated successfully, but these errors were encountered: