Closed gilhooleyd closed 1 year ago
The item has to implement clone for Unique to be an iterator
@Philippe-Cholet's right. @gilhooleyd, could you submit a PR adding the Clone
bound to the Unique
definition:
https://github.com/rust-itertools/itertools/blob/4d2bd4e0e98bbc9d506b83f6357787ad037ab12e/src/unique_impl.rs#L163-L170
Thanks for the quick feedback! I was surprised to see that cargo test
passed with this change, but it looks like there's no test code that calls unique
and then iterates over it. Adding that test and then trying to remove Clone
further I see that the header comments are correct (Unique does clone each item to place it in the hashmap to look for duplicates).
I'll submit another PR to add a test and the trait
This trait requirement appears to no longer be needed.