Commit graph

8 commits

Author SHA1 Message Date
Tatsuyuki Ishi
611b111139 Move unused-extern-crate to late pass 2017-08-27 19:02:24 +09:00
bors
1e60a477a3 Auto merge of #43245 - Gankro:drain-filter, r=sfackler
Add Vec::drain_filter

This implements the API proposed in #43244.

So I spent like half a day figuring out how to implement this in some awesome super-optimized unsafe way, which had me very confident this was worth putting into the stdlib.

Then I looked at the impl for `retain`, and was like "oh dang". I compared the two and they basically ended up being the same speed. And the `retain` impl probably translates to DoubleEndedIter a lot more cleanly if we ever want that.

So now I'm not totally confident this needs to go in the stdlib, but I've got two implementations and an amazingly robust test suite, so I figured I might as well toss it over the fence for discussion.
2017-08-15 22:28:23 +00:00
bors
82be83cf74 Auto merge of #43500 - murarth:string-retain, r=alexcrichton
Add method `String::retain`

Behaves like `Vec::retain`, accepting a predicate `FnMut(char) -> bool`
and reducing the string to only characters for which the predicate
returns `true`.
2017-08-15 16:21:28 +00:00
Murarth
618ac89d25 Add method String::retain
Behaves like `Vec::retain`, accepting a predicate `FnMut(char) -> bool`
and reducing the string to only characters for which the predicate
returns `true`.
2017-08-14 20:42:26 -07:00
Alex Crichton
3fae48107f std: Stabilize utf8_error_error_len feature
Stabilizes:

* `Utf8Error::error_len`

Closes #40494
2017-07-25 07:09:31 -07:00
Alex Crichton
46de2af063 std: Stabilize str_checked_slicing feature
Stabilized

* `<str>::get`
* `<str>::get_mut`
* `<str>::get_unchecked`
* `<str>::get_unchecked_mut`

Closes #39932
2017-07-25 07:09:31 -07:00
Alexis Beingessner
1af42261e1 Add Vec::drain_filter 2017-07-19 10:46:22 -04:00
Murarth
eadda7665e Merge crate collections into alloc 2017-06-13 23:37:34 -07:00
Renamed from src/libcollections/tests/lib.rs (Browse further)