about summary refs log tree commit diff
path: root/src/liballoc/string.rs
AgeCommit message (Collapse)AuthorLines
2018-03-29Move RangeArguments to {core::std}::ops and rename to RangeBoundsSimon Sapin-4/+3
These unstable items are deprecated: * The `std::collections::range::RangeArgument` reexport * The `std::collections::range` module.
2018-03-29Move alloc::Bound to {core,std}::opsSimon Sapin-1/+1
The stable reexport `std::collections::Bound` is now deprecated. Another deprecated reexport could be added in `alloc`, but that crate is unstable.
2018-03-28Rollup merge of #49400 - Diggsey:shrink-to, r=joshtriplettkennytm-0/+28
Implement `shrink_to` method on collections Fixes #49385
2018-03-28Rollup merge of #49243 - murarth:stabilize-retain, r=BurntSushikennytm-3/+1
Stabilize method `String::retain` Closes #43874
2018-03-27Implement `shrink_to` method on collectionsDiggory Blake-0/+28
2018-03-21Stabilize method `String::retain`Murarth-3/+1
2018-03-17Stabilise FromUtf8Error::as_bytesvarkor-2/+1
Closes #40895.
2018-03-15Auto merge of #47813 - kennytm:stable-incl-range, r=nrcbors-4/+4
Stabilize inclusive range (`..=`) Stabilize the followings: * `inclusive_range` — The `std::ops::RangeInclusive` and `std::ops::RangeInclusiveTo` types, except its fields (tracked by #49022 separately). * `inclusive_range_syntax` — The `a..=b` and `..=b` expression syntax * `dotdoteq_in_patterns` — Using `a..=b` in a pattern cc #28237 r? @rust-lang/lang
2018-03-15Stabilize `inclusive_range` library feature.kennytm-4/+4
Stabilize std::ops::RangeInclusive and std::ops::RangeInclusiveTo.
2018-03-14implementing fallible allocation API (try_reserve) for Vec, String and HashMapsnf-0/+74
2018-03-03core: Update stability attributes for FusedIteratorUlrik Sverdrup-1/+1
2018-03-03core: Stabilize FusedIteratorUlrik Sverdrup-1/+1
FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate.
2018-02-22Small grammar fix to docs for String::new().Anthony Deschamps-1/+1
2018-01-06type error method suggestions use whitelisted identity-like conversionsZack M. Davis-0/+1
Previously, on a type mismatch (and if this wasn't preëmpted by a higher-priority suggestion), we would look for argumentless methods returning the expected type, and list them in a `help` note. This had two major shortcomings. Firstly, a lot of the suggestions didn't really make sense (if you used a &str where a String was expected, `.to_ascii_uppercase()` is probably not the solution you were hoping for). Secondly, we weren't generating suggestions from the most useful traits! We address the first problem with an internal `#[rustc_conversion_suggestion]` attribute meant to mark methods that keep the "same value" in the relevant sense, just converting the type. We address the second problem by making `FnCtxt.probe_for_return_type` pass the `ProbeScope::AllTraits` to `probe_op`: this would seem to be safe because grep reveals no other callers of `probe_for_return_type`. Also, structured suggestions are preferred (because they're pretty, but also for RLS and friends). Also also, we make the E0055 autoderef recursion limit error use the one-time-diagnostics set, because we can potentially hit the limit a lot during probing. (Without this, test/ui/did_you_mean/recursion_limit_deref.rs would report "aborting due to 51 errors"). Unfortunately, the trait probing is still not all one would hope for: at a minimum, we don't know how to rule out `into()` in cases where it wouldn't actually work, and we don't know how to rule in `.to_owned()` where it would. Issues #46459 and #46460 have been filed and are ref'd in a FIXME. This is hoped to resolve #42929, #44672, and #45777.
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-4/+1
2017-11-21fix some typosMartin Lindhe-1/+1
2017-11-03Remove unused AsciiExt imports and fix tests related to ascii methodsLukas Kalbertodt-2/+0
Many AsciiExt imports have become useless thanks to the inherent ascii methods added in the last commits. These were removed. In some places, I fully specified the ascii method being called to enforce usage of the AsciiExt trait. Note that some imports are not removed but tagged with a `#[cfg(stage0)]` attribute. This is necessary, because certain ascii methods are not yet available in stage0. All those imports will be removed later. Additionally, failing tests were fixed. The test suite should exit successfully now.
2017-09-17Updated tracking issue for String::splice and its unstable-book entryMichal Budzynski-1/+1
2017-09-14Rollup merge of #44572 - frewsxcv:frewsxcv-from-utf16-lossy, r=QuietMisdreavusCorey Farwell-0/+7
Clarify return type of `String::from_utf16_lossy`. Fixes https://github.com/rust-lang/rust/issues/32874
2017-09-14Rollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcvCorey Farwell-1/+16
Add doc example to String::as_mut_str Fixes #44429.
2017-09-14Clarify return type of `String::from_utf16_lossy`.Corey Farwell-0/+7
Fixes https://github.com/rust-lang/rust/issues/32874
2017-09-10Add doc example to String::as_mut_strTommy Ip-1/+16
Fixes #44429.
2017-09-09Add doc example to String::as_strTommy Ip-0/+10
Fixes #44428.
2017-08-30Rollup merge of #44044 - mattico:string-splice-return, r=dtolnayAlex Crichton-90/+19
Remove Splice struct return value from String::splice The implementation is now almost identical to the one in the RFC. Fixes #44038 cc #32310
2017-08-26Remove Splice struct return value from String::spliceMatt Ickstadt-90/+19
2017-08-25Add missing link in string docGuillaume Gomez-1/+2
2017-08-18Add missing links for String module and typeGuillaume Gomez-32/+41
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-5/+5
Like #43008 (f668999), but _much more aggressive_.
2017-08-15Auto merge of #43500 - murarth:string-retain, r=alexcrichtonbors-0/+51
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-14Add method `String::retain`Murarth-0/+51
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-12Fix some typosBastien Orivel-1/+1
2017-08-08Fix trait name `Deref`Natalie Boehm-1/+1
2017-08-08Update solution to add using `&*` as well as `as_str()`Natalie Boehm-4/+9
2017-08-07Update explanation of deref coercionNatalie Boehm-8/+10
2017-08-04Update String Deref to explain why using &String does not always workNatalie Boehm-2/+25
2017-07-04Rollup merge of #42227 - ollie27:into_to_from, r=aturonMark Simulacrum-4/+4
Convert Intos to Froms. This is a resubmission of #42129 without `impl<T> From<Vec<T>> for Box<[T]>`.
2017-06-30Revert "Stabilize RangeArgument"Steven Fackler-2/+3
This reverts commit 143206d54d7558c2326212df99efc98110904fdb.
2017-06-24Stabilize RangeArgumentSteven Fackler-3/+2
Move it and Bound to core::ops while we're at it. Closes #30877
2017-06-23Removed as many "```ignore" as possible.kennytm-1/+1
Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored.
2017-06-21Update version numbers for From implsOliver Middleton-1/+1
2017-06-21Convert Intos to Froms.Clar Charr-3/+3
2017-06-15Utf8Lossy type with chunks iterator and impl Display and DebugStepan Koltsov-99/+22
2017-06-13Merge crate `collections` into `alloc`Murarth-0/+2287