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
Add Clone trait to Unique #777
Add Clone trait to Unique #777
Conversation
3219eac
to
a70646a
Compare
I was not gonna suggest to make a test for it but I see your point. |
Is the |
Yeah, there's no need to add an extra test here. Delete the test, run |
Thanks for both of your help! I think I've removed the test with the new CL. I added the test originally when I was trying to remove I wish this functionality didn't require Clone, but I see now that it's necessary to do the in-place iteration while removing dups. Thank you again for your time! |
Ah, wait, could you also add it to the |
Like so: #[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
pub struct Unique<I>
where
I: Iterator,
I::Item: Eq + Hash + Clone,
{
iter: UniqueBy<I, I::Item, ()>,
} |
Done! Apologies for the churn |
It's not a problem but could you squash these commits into one simple commit? EDIT: Done, thanks! |
Using a Unique iterator requires the Clone trait, so require this trait when creating the Unique object.
7f16bd6
to
328f956
Compare
Using a Unique iterator requires the Clone trait, so require this trait when creating the Unique object.
See the discussion in #776