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

Rust API Guidelines: Collections implement FromIterator and Extend #1801

Open
oli-obk opened this issue May 29, 2017 · 2 comments
Open

Rust API Guidelines: Collections implement FromIterator and Extend #1801

oli-obk opened this issue May 29, 2017 · 2 comments

Comments

@oli-obk
Copy link
Contributor

oli-obk commented May 29, 2017

C-COLLECT

Clippy cannot know that a type is a collection, but it can detect types with a push or an insert method takint &mut self and one or two types respectively

@clarfonthey
Copy link
Contributor

Could also check for IntoIterator or any of these three traits and make sure that they implement all of them at once.

@llogiq
Copy link
Contributor

llogiq commented Jun 8, 2017

Note however that there are specialized containers that have IntoIterator but not FromIterator, e.g. Option<T>.

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

3 participants