-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
libcore: make iterator adaptors Clone
able
#19827
Conversation
@@ -1444,7 +1445,8 @@ impl<A, B, I, F> RandomAccessIterator<B> for Map<A, B, I, F> where | |||
/// An iterator which filters the elements of `iter` with `predicate` | |||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"] | |||
#[stable] | |||
pub struct Filter<A, I, P> where I: Iterator<A>, P: FnMut(&A) -> bool { | |||
#[deriving(Copy, Clone)] | |||
pub struct Filter<A, I: Iterator<A>, P: FnMut(&A) -> bool> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to "de-where" these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my PR message:
"(Because of #19358 I had to move the struct bounds from the where clause into the parameter list)"
Due to #18045, maybe we should avoid |
Clone
/Copy
ableClone
able
@alexcrichton Removed the |
Doesn't deriving insert bogus bounds (A: Clone) ? |
Yes :/. |
You can copy my code. I wrote up a PR to do this too (didn't see yours). |
@alexcrichton @gankro switched to manual |
Great to get this finally :-) thank you. |
libcore: make iterator adaptors `Clone`able Reviewed-by: alexcrichton
Using a type alias for iterator implementations is fragile since this exposes the implementation to users of the iterator, and any changes could break existing code. This commit changes the iterators of `VecMap` to use proper new types, rather than type aliases. However, since it is fair-game to treat a type-alias as the aliased type, this is a: [breaking-change].
libcore: make iterator adaptors `Clone`able Reviewed-by: alexcrichton
libcore: make iterator adaptors `Clone`able Reviewed-by: alexcrichton
closes rust-lang#12677 (cc @Valloric) cc rust-lang#15294 r? @aturon / @alexcrichton (Because of rust-lang#19358 I had to move the struct bounds from the `where` clause into the parameter list)
closes #12677 (cc @Valloric)
cc #15294
r? @aturon / @alexcrichton
(Because of #19358 I had to move the struct bounds from the
where
clause into the parameter list)