about summary refs log tree commit diff
path: root/src/libstd/str.rs
AgeCommit message (Collapse)AuthorLines
2013-06-13Revert "std: convert {vec,str}::to_owned to methods."Brian Anderson-17/+13
This fixes the strange random crashes in compile-fail tests. This reverts commit 96cd61ad034cc9e88ab6a7845c3480dbc1ea62f3. Conflicts: src/librustc/driver/driver.rs src/libstd/str.rs src/libsyntax/ext/quote.rs
2013-06-13std: remove the invalid NullTerminatedStr instance for &'static str.Huon Wilson-16/+0
A slice of a 'static str is still 'static, but doesn't necessarily have the null terminator.
2013-06-13std: make all strings Equiv-alent to each other, generalise Path.push_many ↵Huon Wilson-2/+14
to take any type of string.
2013-06-12std: fix method renaming.Huon Wilson-1/+1
2013-06-12std: generalise .trim_chars to use CharEq.Huon Wilson-42/+74
2013-06-12std: create Str trait for DRY. Use it on StrVector.Huon Wilson-85/+32
The Str trait collects the various strings types and provides a method for coercing to a slice, so that functions and impls can be written for generic types containing strings (e.g. &[~str], &[&str], ...) without having to write one for each string type (assuming that the impl only needs a slice).
2013-06-12std: convert str::escape_* to methods.Huon Wilson-44/+34
2013-06-12std: convert str::replace to a method.Huon Wilson-33/+33
2013-06-12std: methodise str::capacityHuon Wilson-12/+12
2013-06-12std: remove substr & str::count_*, methodise char_len, implement slice_chars.Huon Wilson-73/+44
The confusing mixture of byte index and character count meant that every use of .substr was incorrect; replaced by slice_chars which only uses character indices. The old behaviour of `.substr(start, n)` can be emulated via `.slice_from(start).slice_chars(0, n)`.
2013-06-12std: unify the str -> [u8] functions as 3 methods: .as_bytes() and ↵Huon Wilson-80/+134
.as_bytes_with_null[_consume](). The first acts on &str and is not nul-terminated, the last two act on strings that are always null terminated (&'static str, ~str and @str).
2013-06-12std: convert str::{*shift,pop}* to methods.Huon Wilson-61/+87
2013-06-12std: convert str::repeat to a method.Huon Wilson-28/+30
2013-06-12std: replace str::append with a methodHuon Wilson-10/+30
2013-06-12std: convert {vec,str}::to_owned to methods.Huon Wilson-15/+19
2013-06-10Replace str::raw::buf_as_slice with c_str_to_static_slice. Close #3843.Ben Blum-5/+12
2013-06-11fix tests, remove some warningsHuon Wilson-10/+1
2013-06-11std: replace str::is_{alphanumeric,whitespace} with the methods.Huon Wilson-25/+7
2013-06-11std: replace str::{starts,ends}_with with the method.Huon Wilson-50/+24
2013-06-11std: replace str::substr with the method.Huon Wilson-13/+3
2013-06-11std: remove str::to_charsHuon Wilson-5/+0
2013-06-11std: basic documentation for the new str methodsHuon Wilson-20/+68
2013-06-10std: remove str::{connect,concat}*.Huon Wilson-17/+0
2013-06-10clean-up unused import warningsHuon Wilson-1/+0
2013-06-10std: fix testsHuon Wilson-13/+13
2013-06-10std: convert str::char_at* to methods.Huon Wilson-130/+125
2013-06-10std: convert str::trim* to methods.Huon Wilson-110/+90
2013-06-10std: convert str::reserve* to methods, and methodise str::push_*.Huon Wilson-165/+167
2013-06-10std: remove str::contains in favour of the methodHuon Wilson-39/+27
2013-06-10std: replace str::find_str* with a methodHuon Wilson-115/+44
2013-06-10std: replace str::{any,all}_between with the iterator equivalent.Huon Wilson-60/+0
2013-06-10std: convert character-based str::find_* to methods. Add .slice_{to,from} ↵Huon Wilson-363/+134
methods.
2013-06-10std: convert each_split_str to an iteratorHuon Wilson-114/+112
2013-06-10std: remove str::{len, slice, is_empty} in favour of methods.Huon Wilson-107/+89
2013-06-10std: replace str::all/any fns and methods with iteratorsHuon Wilson-50/+2
2013-06-10std: replace str::each_split* with an iteratorHuon Wilson-404/+182
2013-06-08remove deprecated vec::{is_empty, len} functionsDaniel Micay-2/+2
2013-06-09std: replace the str::each* fns/methods with byte iteratorsHuon Wilson-151/+69
2013-06-09std: remove each_char* fns and methods from str, replaced by iterators.Huon Wilson-136/+57
2013-06-09std: remove {all*,any*,count} in favour of iteratorsHuon Wilson-13/+14
2013-06-09std: add reverse vec iterators, replace vec::each*_reverse.Huon Wilson-1/+1
2013-06-07std: Change str::from_bytes to raise a condition on invalid inputTim Chevalier-6/+31
As per #4765
2013-06-04librustc: Disallow multiple patterns from appearing in a "let" declaration.Patrick Walton-12/+15
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
2013-06-03rename the Ptr trait to RawPtrDaniel Micay-1/+1
Closes #6607
2013-06-03Add traits for concat and connect methodsBrendan Zabarauskas-71/+141
2013-05-31Add as_c_str method on stringsBen Striegel-22/+39
2013-05-30Require documentation by default for libstdAlex Crichton-8/+42
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-28Silence various warnings throughout test modulesAlex Crichton-1/+1
2013-05-27syntax highlight code examples in docstringsDaniel Micay-5/+5
2013-05-23cleanup warnings from libstdErick Tryzelaar-276/+269