summary refs log tree commit diff
path: root/src/libstd/str.rs
AgeCommit message (Collapse)AuthorLines
2013-06-30Specialize to_str_common for floats/integers in strconvAlex Crichton-3/+32
This allows the integral paths to avoid allocations on the heap Closes #4424, #4423
2013-06-29auto merge of #7475 : Seldaek/rust/fixsplit, r=cmrbors-1/+10
I almost got locked out of my machine because I misunderstood the purpose of the function and called it with a limit of uint::max_value, which turned this function into an almost endless loop.
2013-06-29Removing a lot of usage of '&const'Alex Crichton-4/+4
2013-06-29'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep ↵Ben Blum-2/+2
for making them noncopyable.
2013-06-29Optimize str::each_split_within when it is called with large limitsJordi Boggiano-1/+10
2013-06-28Rewrite each_path to allow performance improvements in the future.Patrick Walton-10/+11
Instead of determining paths from the path tag, we iterate through modules' children recursively in the metadata. This will allow for lazy external module resolution.
2013-06-28librustc: Fix merge fallout.Patrick Walton-2/+4
2013-06-28librustc: Rewrite reachability and forbid duplicate methods in type ↵Patrick Walton-1/+2
implementations. This should allow fewer symbols to be exported.
2013-06-28libstd: Fix merge fallout.Patrick Walton-2/+3
2013-06-28librustc: Disallow "mut" from distributing over bindings.Patrick Walton-1/+69
This is the backwards-incompatible part of per-binding-site "mut".
2013-06-27auto merge of #7430 : huonw/rust/vec-kill, r=thestingerbors-4/+5
2013-06-28std: silence some test warnings.Huon Wilson-1/+2
2013-06-28Convert vec::{reserve, reserve_at_least, capacity} to methods.Huon Wilson-3/+3
2013-06-24Merge remote-tracking branch 'reusee/master' into HEADBrian Anderson-1/+1
2013-06-24remove old_iterDaniel Micay-2/+0
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and written in an ancient dialect of Rust so I've just removed it this also removes `to_vec` from DList because it's provided by `std::iter::to_vec` an Iterator implementation is added for OptVec but some transitional internal iterator methods are still left
2013-06-23vec: remove BaseIter implementationDaniel Micay-5/+5
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-22replaced some 'std::' with 'extra::' in commentsreus-1/+1
2013-06-21replace vec::find with the IteratorUtil methodDaniel Micay-1/+1
2013-06-21vec: rm old_iter implementations, except BaseIterDaniel Micay-1/+1
The removed test for issue #2611 is well covered by the `std::iterator` module itself. This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-44/+44
2013-06-17std: add Zero impls for &[] and &str.Huon Wilson-0/+20
2013-06-16auto merge of #7142 : alexcrichton/rust/deriving-zero, r=pcwaltonbors-0/+11
This allows mass-initialization of large structs without having to specify all the fields. I'm a bit hesitant, but I wanted to get this out there. I don't really like using the `Zero` trait, because it doesn't really make sense for a type like `HashMap` to use `Zero` as the 'blank allocation' trait. In theory there'd be a new trait, but then that's adding cruft to the language which may not necessarily need to be there. I do think that this can be useful, but I only implemented `Zero` on the basic types where I thought it made sense, so it may not be all that usable yet. (opinions?)
2013-06-16std: allow any sort of string to be Added with +.Huon Wilson-2/+22
2013-06-16std: test-fixes, remove warnings, syntax highlighting for code examples.Huon Wilson-3/+3
2013-06-16std: continue improving the comparison trait impls for str.Huon Wilson-166/+128
This moves them all into the traits submodule, and delegates Ord to the TotalOrd instance. It also deletes the stand-alone lt, gt, ge and le functions.
2013-06-16std: simplify the string comparison implementations, using iterators.Huon Wilson-30/+14
2013-06-16std: convert str::to_utf16 to a method.Huon Wilson-27/+28
2013-06-16std: convert str::{map,levdistance,subslice_offset} to methods.Huon Wilson-108/+110
The first two become map_chars and lev_distance. Also, remove a few allocations in rustdoc.
2013-06-14Add Zero impls for lots of common typesAlex Crichton-0/+11
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