Skip to content

Making str allocate less #3: split_* - #5555

Merged
bors merged 7 commits into
rust-lang:incomingfrom
Kimundi:str-dealloc-3
Mar 26, 2013
Merged

bors merged 7 commits into
rust-lang:incomingfrom
Kimundi:str-dealloc-3

Conversation

@Kimundi

@Kimundi Kimundi commented Mar 26, 2013

Copy link
Copy Markdown
Contributor
  • 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

Kimundi commented Mar 26, 2013

Copy link
Copy Markdown
Contributor Author

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

@huonw

huonw commented Mar 26, 2013

Copy link
Copy Markdown
Contributor

@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

Kimundi commented Mar 26, 2013

Copy link
Copy Markdown
Contributor Author

@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
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
5555: Bump test timeout for macs r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
RalfJung added a commit to RalfJung/rust that referenced this pull request Nov 7, 2026
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