Skip to content
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

try_fold_while #830

Open
mightyiam opened this issue Dec 25, 2023 · 2 comments
Open

try_fold_while #830

mightyiam opened this issue Dec 25, 2023 · 2 comments
Labels
fallible-iterator Iterator of results/options

Comments

@mightyiam
Copy link
Contributor

I found myself wanting a try_fold_while... Since there fold_while is not in std, I don't suppose it's the right time to RFC try_fold_while in std. So, would it be accepted here?

I haven't gotten into any detail, but I imagine it to be a straightforward combination of try_fold and fold_while.

@Philippe-Cholet
Copy link
Member

The Try trait behind try_fold is unstable so we can't specialize them. And I think try_ methods should use Try. We only have one try_ method: try_collect which is in conflict with the unstable std one. An alternative would be fold_while_ok (we have a bunch of _ok methods, I don't know if we want more), or use our process_results (it_res.process_results(|it| it.fold_while(...))) but it doesn't specialize try_fold either so I guess the performance might be unsatisfying.

@mightyiam
Copy link
Contributor Author

I suppose we wait, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fallible-iterator Iterator of results/options
Projects
None yet
Development

No branches or pull requests

2 participants