itertools
itertools copied to clipboard
Support owned iterators for GroupBy and IntoChunks `into_iter()`
Resolves #499
Thanks for the PR! I'm going to defer on reviewing it for a bit, since it appears to be a breaking change, and I want to focus on non-breaking PRs for the near-future.
Hi, I see that this build failure has to do with how the Rust config is set up on the Travis CL continuous integration...but when I pull the offending branch and run locally, I can run the tests and there isn't a problem.
I want this functionality, but actually I want to increase it's capability to an Arc instead of an Rc because I want to use the chunking across an await in an asynchronous function. Still it would probably be good to get this implementation into the code first. Can you advise on how I can get this error on my local machine so I can fix it and send it back to you? Looking at your build statements, it looks like it the std::rc isn't being included in your cargo config possibly? However, when I pulled master mainline into this branch on my local distribution, I still couldn't get this compile error. So, how do I recreate your setup locally, what do I need to do?
Okay, sorry, I delved a little bit more and then I found what commands were being run. I'll work on fixing it
Okay, I fixed it and I can confirm that my one line change made this work and is not a breaking change. However, I am not the original committer. I'm not sure how we could proceed, can you please advise? I would like to get this into mainline if it's not a problem and then I would like to change this to ultimately make IntoChunks Sync and Send.
Please send the fix and I'll look at it and most likely incorporate it in there. 🙂 However with regards to the Send/Sync change, how do you mean to deal with the Refcell? (which was already there iirc - hard to read quickly on my phone due to this crate not being rustfmt'ed.)
Well, obviously Refcell has to go. You can't be Sync and have RefCell or Cell underneath the hood. Honestly, I need to play around with it a bit some more. Holding references across asyncs call is obviously a horrible idea and I'm still quite new to Pinning. However, I can use iterators across asyncs, so I'm confident a solution exists. I doubt it's a simple as moving to an Arc_Mutex (Couldn't write the < Mutex > for some reason) combination, but we will see. More than that, I know people will be sweating performance implications, so maybe it'd deserve it's own structs and function calls? Just general thoughts, should probably move this conversation somewhere more appropriate.
@Ten0 I only skimmed the changes but I like the idea of this PR (implement IntoIterator for both X and &X), I think it would help solve #665 too.
It would be a (reasonable enough) breaking change though.
I think borrowed_iter should be renamed iter.