rust/src/liballoc
Mazdak Farrokhzad 9ee373fd94
Rollup merge of #69784 - benesch:fast-strip-prefix-suffix, r=kennytm
Optimize strip_prefix and strip_suffix with str patterns

As mentioned in https://github.com/rust-lang/rust/issues/67302#issuecomment-585639226.
I'm not sure whether adding these methods to `Pattern` is desirable—but they have default implementations so the change is backwards compatible. Plus it seems like they're slated for wholesale replacement soon anyway? #56345

----

Constructing a Searcher in strip_prefix and strip_suffix is
unnecessarily slow when the pattern is a fixed-length string. Add
strip_prefix and strip_suffix methods to the Pattern trait, and add
optimized implementations of these methods in the str implementation.
The old implementation is retained as the default for these methods.
2020-03-31 15:59:40 +02:00
..
alloc Remove usable_size APIs 2020-03-03 00:08:24 +01:00
benches Auto merge of #68827 - ssomers:btree_navigation_revisited, r=Mark-Simulacrum 2020-02-28 09:32:34 +00:00
collections must_use on split_off 2020-03-24 17:35:40 +00:00
prelude Format liballoc with rustfmt 2019-11-29 20:25:07 -08:00
raw_vec Allow ZSTs in AllocRef 2020-03-08 11:01:12 +01:00
rc Format the world 2019-12-22 17:42:47 -05:00
sync Format the world 2019-12-22 17:42:47 -05:00
tests fix BTreeMap test compilation with Miri 2020-03-30 12:04:05 +02:00
alloc.rs Allow ZSTs in AllocRef 2020-03-08 11:01:12 +01:00
borrow.rs Format the world 2019-12-22 17:42:47 -05:00
boxed.rs Bump the bootstrap compiler 2020-03-15 19:43:25 +01:00
Cargo.toml bump rand to fix Miri failures 2019-08-04 14:50:26 +02:00
fmt.rs Add note about localization to std::fmt docs 2020-03-09 12:31:33 -04:00
lib.rs introduce negative_impls feature gate and document 2020-03-26 06:52:55 -04:00
macros.rs Scope format! temporaries 2019-09-27 17:36:45 -04:00
raw_vec.rs Allow ZSTs in AllocRef 2020-03-08 11:01:12 +01:00
rc.rs Rollup merge of #68099 - lukaslueg:into_raw_unsafe, r=LukasKalbertodt 2020-03-22 15:48:28 +01:00
slice.rs don't create variable bindings just to return the bound value immediately (clippy::let_and_return) 2020-03-22 00:35:25 +01:00
str.rs Format the world 2019-12-22 17:42:47 -05:00
string.rs Optimize strip_prefix and strip_suffix with str patterns 2020-03-30 11:10:21 -04:00
sync.rs Rollup merge of #68099 - lukaslueg:into_raw_unsafe, r=LukasKalbertodt 2020-03-22 15:48:28 +01:00
task.rs Apply suggestions from code review 2020-03-23 15:45:30 +01:00
tests.rs Format liballoc with rustfmt 2019-11-29 20:25:07 -08:00
vec.rs Rollup merge of #68692 - jyn514:vec-from-array, r=LukasKalbertodt 2020-03-29 11:50:10 +02:00