-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
std: Rename Iterator adaptor types to drop the -Iterator suffix #8090
Conversation
ok thestinger hinted that it might be suboptimal to have structs named |
I'm actually super in-favor of naming schemes like this. In my opinion this is one of the things which I believe go did really well. It's different for them in that it's impossible to import a name into a package, you can only import package names into packages. That way in go when referencing types it's I'm personally in favor of this change, but rust is different in that it is possible to import For this patch in particular, I would be in favor of removing any I'm hesitant to r+ this though because those are my own opinions and there's probably contention over this, so what are others' thoughts? |
@alexcrichton: It's reasonable to have a type named When I originally started naming these I considered coming up with shorter names for most, but ended up just using an |
I do agree that we should definitely pick one. We should either use the |
I prefer exact correspondance, |
Drop the "Iterator" suffix for the the structs in std::iterator. Filter, Zip, Chain etc. are shorter type names for when iterator pipelines need their types written out in full in return value types, so it's easier to read and write. the iterator module already forms enough namespace.
rebased only to resolve conflicts |
Drop the "Iterator" suffix for the the structs in std::iterator. Filter, Zip, Chain etc. are shorter type names for when iterator pipelines need their types written out in full in return value types, so it's easier to read and write. the iterator module already forms enough namespace.
Fix `enum_variants` FP on prefixes that are not camel-case closes rust-lang#8090 Fix FP on `enum_variants` when prefixes are only a substring of a camel-case word. Also adds some util helpers on `str_utils` to help parsing camel-case strings. This changes how the lint behaves: 1. previously if the Prefix is only a length of 1, it's going to get ignored, i.e. these were previously ignored and now is warned ```rust enum Foo { cFoo, cBar, cBaz, } enum Something { CCall, CCreate, CCryogenize, } ``` 2. non-ascii characters that doesn't have casing will not be split, ```rust enum NonCaps { PrefixXXX, PrefixTea, PrefixCake, } ``` will be considered as `PrefixXXX`, `Prefix`, `Prefix`, so this won't lint as opposed to fired previously. changelog: [`enum_variant_names`] Fix FP when first prefix are only a substring of a camel-case word. --- (Edited by `@xFrednet` removed some non ascii characters)
Drop the "Iterator" suffix for the the structs in std::iterator.
Filter, Zip, Chain etc. are shorter type names for when iterator
pipelines need their types written out in full in return value types, so
it's easier to read and write. the iterator module already forms enough
namespace.