about summary refs log tree commit diff
path: root/src/liballoc/str.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-576/+0
2020-07-18Use intra-doc links in alloc::StringManish Goregaokar-14/+3
2020-06-19`#[deny(unsafe_op_in_unsafe_fn)]` in liballocLeSeulArtichaut-1/+1
2020-04-03Replace max/min_value() with MAX/MIN assoc constsLinus Färnstrand-1/+1
2019-12-22Format the worldMark Rousskov-33/+31
2019-10-22Apply clippy::needless_return suggestionsMateusz Mikuła-1/+1
2019-10-01Remove unneeded `fn main` blocks from docsLzu Tao-4/+2
2019-07-09Update src/liballoc/str.rsSimon Sapin-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-07-09Take separator by value in `[T]::join`Simon Sapin-1/+1
2019-07-09Split the SliceConcat trait into Concat and JoinSimon Sapin-5/+12
2019-07-09Remove obsolete “should not have to exist” reasonsSimon Sapin-3/+1
2019-07-05Replace SliceConcatExt trait with inherent methods and SliceConcat helper traitSimon Sapin-7/+7
Before this change `SliceConcatExt` was an unstable extension trait with stable methods. It was in the libstd prelude, so that its methods could be used on the stable channel. This replaces it with inherent methods, which can be used without any addition to the prelude. Since the methods are stable and very generic (with for example a return type that depends on the types of parameters), an helper trait is still needed. But now that trait does not need to be in scope for the methods to be used. Removing this depedency on the libstd prelude allows the methods to be used in `#![no_std]` crate that use liballoc, which does not have its own implicitly-imported prelude.
2019-07-01Convert more usages overChris Gregory-1/+1
2019-06-22Rollup merge of #61146 - czipperz:SliceConcatExt-connect-default-to-join, ↵Mazdak Farrokhzad-4/+0
r=sfackler SliceConcatExt::connect defaults to calling join It makes sense to default a deprecated method to the new one. Precedence example is `Error::cause` defaults to calling `Error::source`.
2019-06-01Add an unusual-conversion example to to_uppercaseScott McMurray-0/+7
Like how to_lowercase has ὈΔΥΣΣΕΎΣ.
2019-05-24SliceConcatExt::connect defaults to calling joinChris Gregory-4/+0
2019-04-30Implement `BorrowMut<str>` for `String`YOSHIOKA Takuma-1/+9
Closes rust-lang/rfcs#1282.
2019-04-22Remove double trailing newlinesvarkor-1/+0
2019-04-12Re-export core::str::{EscapeDebug, EscapeDefault, EscapeUnicode} in stdLzu Tao-0/+2
2019-02-12Move str::escape_* to libcoreSimon Sapin-118/+0
2019-02-12Stabilize str::escape_* methodsSimon Sapin-13/+7
FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12New return types for str::escape_* that impl Display and Iterator<char>Simon Sapin-12/+96
As FCP’ed in the tracking issue: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-03Auto merge of #58081 - Centril:liballoc-2018, r=oli-obkbors-7/+7
Transition liballoc to Rust 2018 This transitions liballoc to Rust 2018 edition and applies relevant idiom lints. I also did a small bit of drive-by cleanup along the way. r? @oli-obk I started with liballoc since it seemed easiest. In particular, adding `edition = "2018"` to libcore gave me way too many errors due to stdsimd. Ideally we should be able to continue this crate-by-crate until all crates use 2018.
2019-02-03liballoc: revert nested imports style changes.Mazdak Farrokhzad-20/+14
2019-02-02liballoc: prefer imports of borrow from libcore.Mazdak Farrokhzad-1/+2
2019-02-02liballoc: refactor & fix some imports.Mazdak Farrokhzad-14/+19
2019-02-02liballoc: cargo check passes on 2018Mazdak Farrokhzad-5/+5
2019-02-01Stabilize split_ascii_whitespaceSimon Sapin-1/+1
Tracking issue FCP to merge: https://github.com/rust-lang/rust/issues/48656#issuecomment-442372750
2018-12-25Remove licensesMark Rousskov-10/+0
2018-09-27liballoc: mark str.to_owned() and String::from(&str) as #[inline].Matthias Krüger-0/+1
Fixes #53681
2018-09-20std: Check for overflow in `str::repeat`Alex Crichton-0/+13
This commit fixes a buffer overflow issue in the standard library discovered by Scott McMurray where if a large number was passed to `str::repeat` it may cause and out of bounds write to the buffer of a `Vec`. This bug was accidentally introduced in #48657 when optimizing the `str::repeat` function. The bug affects stable Rust releases 1.26.0 to 1.29.0. We plan on backporting this fix to create a 1.29.1 release, and the 1.30.0 release onwards will include this fix. The fix in this commit is to introduce a deterministic panic in the case of capacity overflow. When repeating a slice where the resulting length is larger than the address space, there’s no way it can succeed anyway! The standard library and surrounding libraries were briefly checked to see if there were othere instances of preallocating a vector with a calculation that may overflow. No instances of this bug (out of bounds write due to a calculation overflow) were found at this time. Note that this commit is the first steps towards fixing this issue, we'll be making a formal post to the Rust security list once these commits have been merged.
2018-08-22docs: std::string::String.repeat(): slightly rephrase to be more in-line ↵Matthias Krüger-1/+1
with other descriptions. add ticks around a few keywords in other descriptions.
2018-07-22Rollup merge of #51807 - newpavlov:deprecate_str_slice, r=alexcrichtonkennytm-4/+4
Deprecation of str::slice_unchecked(_mut) Closes #51715 I am not sure if 1.28.0 or 1.29.0 should be used for deprecation version, for now it's 1.28.0. Additionally I've replaced `slice_unchecked` uses with `get_unchecked`. The only places where this method is still used are `src/liballoc/tests/str.rs` and `src/liballoc/tests/str.rs`.
2018-07-06Handle array manually in string case conversion methodsPazzaz-2/+27
2018-06-29Move some alloc crate top-level items to a new alloc::collections moduleSimon Sapin-1/+0
This matches std::collections
2018-06-27Add str::split_ascii_whitespace.Clar Charr-0/+2
2018-06-26Deprecation of str::slice_uncheked(_mut)newpavlov-4/+4
2018-06-01incorporate changes from code reviewEmerentius-27/+33
further reduce unsafe fn calls reduce right drift assert! sufficient capacity
2018-06-01compacts join codeEmerentius-30/+14
2018-06-01optimize joining and concatenation for slicesEmerentius-36/+102
for both Vec<T> and String - eliminates the boolean first flag in fn join() for String only - eliminates repeated bounds checks in join(), concat() - adds fast paths for small string separators up to a len of 4 bytes
2018-05-21Avoid counting characters and add explanatory comment to testvarkor-1/+7
2018-05-21Only escape extended grapheme characters in the first positionvarkor-1/+4
2018-05-17Switch to 1.26 bootstrap compilerMark Simulacrum-6/+1
2018-05-09move See also links to topMichael Lamparski-2/+2
2018-05-07Add explanation for #[must_use] on string replace methodsManish Goregaokar-2/+4
2018-04-26Rollup merge of #50177 - matthiaskrgr:std_std_replacen__must_use, r=oli-obkGuillaume Gomez-0/+2
mark std::str::replace(,n) as #[must_use] let x = "a b c c"; x.replacen("c", "d", 2"); might not do what people might think it does.
2018-04-24Auto merge of #48999 - GuillaumeGomez:add-repeat-on-slice, r=Kimundibors-53/+1
Add repeat method on slice Fixes #48784.
2018-04-23mark std::str::replacen and std::str::replace as #[must_use].Matthias Krüger-0/+2
2018-04-21Replace StrExt with inherent str methods in libcoreSimon Sapin-1724/+7
2018-04-19Tweak some stabilizations in libstdAlex Crichton-42/+0
This commit tweaks a few stable APIs in the `beta` branch before they hit stable. The `str::is_whitespace` and `str::is_alphanumeric` functions were deleted (added in #49381, issue at #49657). The `and_modify` APIs added in #44734 were altered to take a `FnOnce` closure rather than a `FnMut` closure. Closes #49581 Closes #49657