Skip to content

Making str allocate less #3: split_* #5555

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

Merged
merged 7 commits into from
Mar 26, 2013
Merged

Conversation

Kimundi
Copy link
Member

@Kimundi Kimundi commented Mar 26, 2013

  • Most functions that used to return ~[~str] for a list of substrings got turned into iterators over &str slices
  • Some cleanup of apis, docs and code layout

@Kimundi
Copy link
Member Author

Kimundi commented Mar 26, 2013

Hat tip to @dbaupp, who also started some of that work

@huonw
Copy link
Member

huonw commented Mar 26, 2013

@Kimundi, thanks, but the work is entirely yours :)

Just looking at the code, it seems like it would worth leaving the methods that return ~[~str], since the for string.each |s| { list.push(s.to_owned()) } pattern comes up a lot.

@Kimundi
Copy link
Member Author

Kimundi commented Mar 26, 2013

@dbaupp Yeah, I might re-introduce the old names once strcat's Iterators are in core. Ideally you could then chain those with map() etc like you can with vectors, but for now it's probably a good idea to at least guide new code to not allocate as much. :)

bors added a commit that referenced this pull request Mar 26, 2013
- Most functions that used to return `~[~str]` for a list of substrings got turned into iterators over `&str` slices
- Some cleanup of apis, docs and code layout
@bors bors closed this Mar 26, 2013
@bors bors merged commit de468c8 into rust-lang:incoming Mar 26, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 5, 2020
…r=phansch

Move match_on_vec_items to pedantic

Addresses rust-lang/rust-clippy#5551 (comment)

Fixes rust-lang#5553

changelog: Move [`match_on_vec_items`] to pedantic

r? @phansch
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

Successfully merging this pull request may close these issues.

4 participants