-
Notifications
You must be signed in to change notification settings - Fork 13.8k
repeat iter: tests + panic in fold #146674
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
base: master
Are you sure you want to change the base?
Conversation
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
r? @jhpratt |
|
Arguably one could use the infinite fold for side effects? It would be kind of weird though. |
@asquared31415 true, I may have to take that out then... |
Adapters like |
@LIParadise I believe that assert should hold, but let me add a test. |
@LIParadise I was wrong, but I was able to fix it... |
If that's the case, I'm afraid there are quite a few types that's |
Also crates like itertools might have a word or two.
Part of me agree that |
@LIParadise I think #146410 (comment) describes it well. Alternatively you can imagine two infinite sequences with their infinite ends glued together. It amounts to the same thing. |
I'm off-rotation as I don't have the time to handle nontrivial reviews at the moment. r? libs |
A continuation of #146410 which changes the direct
count
impl for afold
impl, to which the defaultcount
delegates. Also added tests for the new behavior.