Using I: IntoIterator instead of T: IntoIterator in the standard library
#294
George-Ogden
started this conversation in
API Guidelines
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi
Firstly, apologies if this is the wrong place or if people vehemently disagree with this point. I think that this is important for documentation, as well as consistency.
I searched for the following code snippets in the Rust codebase, and here are the results:
I think for standardisation,
Ishould be used forIteratortraits andIntoIteratortraits (thenJ).This is already common in the
itertools(https://docs.rs/itertools/latest/itertools/) crate, which then uses this as part of the documentation.In particular,
<T, I: IntoIterator<T>>communicates a much clearer intention that<S, T: IntoIterator<S>>as seen here:Please let me know your thoughts.
All reactions