Skip to content
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

caller of Extend should call clone #30

Open
lonnen opened this issue Nov 3, 2020 · 1 comment
Open

caller of Extend should call clone #30

lonnen opened this issue Nov 3, 2020 · 1 comment

Comments

@lonnen
Copy link
Owner

lonnen commented Nov 3, 2020

Matklad suggests removing Extend implementations for Extend<(&'a T, &'a usize)> and Extend<(&'a T)> because they obscure a simple clone that the caller could explicitly do without these.

de16931#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R1186

@lonnen
Copy link
Owner Author

lonnen commented Jul 26, 2021

I keep going back and forth on this. We need clone for compact storage-by-value but I don't remember why I needed it here.

Consider also the ultimate implementation of extend for sets in the stdlib:
https://docs.rs/hashbrown/0.1.8/src/hashbrown/map.rs.html?search=#2436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant