Skip to content

Consider removing the _iter suffixes on specialized Iterator constructors #9440

Closed
@Kimundi

Description

@Kimundi

The names tend to become increasingly long, and if there is no alternative way it seems silly to add to the name. The _iter suffix can still be used for cases where an operation is also implemented in a non-iterator way, or where no better name can be found.

For example, the iterator constructors for StrSlice would improve greatly from this:

byte_iter()             -> bytes()
byte_rev_iter()         -> bytes_rev()
char_offset_iter()      -> chars_offset()
char_offset_rev_iter()  -> chars_offset_rev()
split_iter()            -> split()
rsplit_iter()           -> rsplit()
splitn_iter()           -> split_n()
rsplitn_iter()          -> rsplit_n()
split_terminator_iter() -> split_terminator()
split_str_iter()        -> split_str()
matches_index_iter()    -> match_indices()
line_iter()             -> lines()
any_line_iter()         -> lines_any()
word_iter()             -> words()
// Can't think of something shorter for these two:
nfd_iter()              -> nfd_iter()
nfkd_iter()             -> nfkd_iter()
// These would be Iterable impls, and thus keep the name:
iter()                  -> iter()
rev_iter()              -> rev_iter()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions