-
Notifications
You must be signed in to change notification settings - Fork 112
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
implement Clone
for iterator types
#134
Comments
Absolutely. There's no good reason why they shouldn't implement |
I've hit the need of them just today. @mikeyhew are you working on the PR, or should I try to find a bit of time to give them a try? |
@vorner I'm not working on a PR for this, all yours! |
vorner
added a commit
to vorner/bitmaps
that referenced
this issue
Nov 4, 2020
Most importantly, Clone, which is generally useful (to pass it to somewhere and iterate over it multiple times, but also for reverse dependencies, see bodil/im-rs#134). Piggy-backing Debug when at it, because, why not. *Not* implementing Copy, as that could lead to footguns (iterators forking by accident would do confusing things).
vorner
added a commit
to vorner/sized-chunks
that referenced
this issue
Nov 4, 2020
Most importantly, Clone. See bodil/im-rs#134. Piggy-backing Debug when at it, because, why not. Not implementing Copy even where it would be possible, as that could turn into footgun (iterators "forking"). Not implementing Clone on consuming iterators, as that also clones the elements and that's probably not intended.
vorner
added a commit
to vorner/sized-chunks
that referenced
this issue
Nov 4, 2020
Most importantly, Clone. See bodil/im-rs#134. Piggy-backing Debug when possible, because, why not. Not implementing Copy even where it would be possible, as that could turn into footgun (iterators "forking"). Not implementing Clone on consuming iterators, as that also clones the elements and that's probably not intended.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
std::vec::Iter<'a, T>
implementsClone
, but it seems thatim::vector::Iter<'a, T>
does not. Would it be possible to to implementClone
for all of the by-referenceIter
types inim
, and would you accept a PR adding the impls?The text was updated successfully, but these errors were encountered: