about summary refs log tree commit diff
path: root/src/libcore/str.rs
AgeCommit message (Collapse)AuthorLines
2013-04-20core: remove unused 'mut' variablesAlex Crichton-3/+3
2013-04-20Added Ascii typeMarvin Löbel-2/+15
2013-04-20Made unsafely safe functions unsafe again, for safetyMarvin Löbel-4/+4
2013-04-20Cleaned up case related functions a bitMarvin Löbel-22/+19
2013-04-20Replaced many instances of reinterpret_cast with transmuteMatthijs Hofstra-9/+9
2013-04-19core: clean up tests (mostly unused unsafe blocks)Alex Crichton-2/+2
2013-04-19librustc: WIP patch for using the return value.Patrick Walton-0/+9
2013-04-19librustc: Optimize metadata::decoder::item_name.Patrick Walton-0/+9
2013-04-19libcore: clarify documentation for char_at(_reverse)Huon Wilson-4/+4
2013-04-18core: add a str iteratorHuon Wilson-0/+56
2013-04-14core: remove unnecessary unsafe blocks/functionsAlex Crichton-25/+19
2013-04-12auto merge of #5827 : ↵bors-1/+5
nikomatsakis/rust/issue-5656-change-meaning-of-borrowed-self, r=pcwalton See #5656 for details. r? @pcwalton
2013-04-11Add example for str::subslice_offsetMarvin Löbel-0/+19
2013-04-11Added str::from_slice_with_null() to cast a &[u8] to &strMarvin Löbel-8/+128
Added str::subslice_offset() Renamed slice_bytes_uniqe to slice_bytes_owned
2013-04-10Reason about nested free variables that appear in a functionNiko Matsakis-1/+5
signature. In a nutshell, the idea is to (1) report an error if, for a region pointer `'a T`, the lifetime `'a` is longer than any lifetimes that appear in `T` (in other words, if a borrowed pointer outlives any portion of its contents) and then (2) use this to assume that in a function like `fn(self: &'a &'b T)`, the relationship `'a <= 'b` holds. This is needed for #5656. Fixes #5728.
2013-04-08Removing no longer needed unsafe blocksAlex Crichton-34/+24
2013-04-03Removing mut fields from vec.rs, at_vec.rs, str.rs, unstable.rs, and cell.rs.Matthijs Hofstra-2/+2
2013-03-31Fix underflow in char_range_at_reverseMarvin Löbel-2/+15
Added char_range_at_reverse underflow test
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-307/+307
2013-03-28Removing unused importsAlex Crichton-2/+2
2013-03-28Unbreak 'rustc --help'Marvin Löbel-1/+2
2013-03-27add a TotalEq traitDaniel Micay-1/+25
2013-03-26librustc: Remove obsolete syntaxPatrick Walton-16/+42
2013-03-26librustc: Modify all code to use new lifetime binder syntaxPatrick Walton-37/+49
2013-03-26libcore: Change `[const T]` to `const [T]` everywherePatrick Walton-3/+3
2013-03-26Added more missing lifetime annotationsMarvin Löbel-8/+8
2013-03-26Added missing lifetime annotations, doc and whitespace cleanupsMarvin Löbel-66/+66
2013-03-26Fixed all use sites and testsMarvin Löbel-137/+141
2013-03-26Isolated bug, static vector seems to behave differently than fixed sized oneMarvin Löbel-30/+0
2013-03-26Switched over a bunch of splitting funktions to non-allocating iteratorsMarvin Löbel-53/+61
2013-03-26pre-rebase commitMarvin Löbel-99/+102
2013-03-26Moved float str buffer constants to the strconv moduleMarvin Löbel-8/+0
2013-03-25libcore: implement `str::each_char_reverse` correctly.Huon Wilson-10/+9
Previously, `each_char_reverse` was not iterating at all, so the testcase never ran properly.
2013-03-22librustc: Remove the `const` declaration form everywherePatrick Walton-18/+18
2013-03-22librustdoc: Remove `pure` from fuzzer and rustdoc.Patrick Walton-1/+1
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-216/+216
2013-03-22auto merge of #5398 : dbaupp/rust/core-readlines, r=graydonbors-26/+92
The `each_line` function in `ReaderUtil` acts very differently to equivalent functions in Python, Ruby, Clojure etc. E.g. given a file `t` with contents `trailing\nnew line\n` and `n` containing `no trailing\nnew line`: Rust: ```Rust t: ~[~"trailing", ~"new line", ~""] n: ~[~"no trailing", ~"new line"] ``` Python: ```Python >>> open('t').readlines() ['trailing\n', 'new line\n'] >>> open('n').readlines() ['no trailing\n', 'new line'] ``` Ruby: ```Ruby irb(main):001:0> File.readlines('t') => ["trailing\n", "new line\n"] irb(main):002:0> File.readlines('n') => ["no trailing\n", "new line"] ``` Clojure ```Clojure user=> (read-lines "t") ("trailing" "new line") user=> (read-lines "n") ("no trailing" "new line") ``` The extra string that rust includes at the end is inconsistent, and means that it is impossible to distinguish between the "real" empty line a file that ends `...\n\n`, and the "fake" one after the last `\n`. The code attached makes Rust's `each_line` act like Clojure (and PHP, i.e. not including the `\n`), as well as adjusting `str::lines` to fix the trailing empty line problem. Also, add a convenience `read_lines` method to read all the lines in a file into a vector.
2013-03-23libcore: handle trailing newlines more like other languages.Huon Wilson-26/+92
Specifically, `lines` and `each_line` will not emit a trailing empty string when given "...\n". Also, add `read_lines`, which just collects all of `each_line` into a vector, and `split_*_no_trailing` which will is the generalised version of `lines`.
2013-03-21core: fix a typo in levdistanceErick Tryzelaar-2/+2
2013-03-21Un-renamed trim and substr functions.Marvin Löbel-58/+58
2013-03-21Switched over substr and trim functions in str to be non-allocating, ↵Marvin Löbel-87/+99
temporary renamed them to better track use-sites
2013-03-21back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> ↵Marvin Löbel-48/+48
slice_unique
2013-03-21removed str::slice_DBG_UNIQMarvin Löbel-66/+42
2013-03-21renamed str::view -> slice_DBG_BRWDMarvin Löbel-54/+66
renamed str::slice -> slice_DBG_UNIQ changed vec slice method -> to_owned() renamed vec view method -> slice_V_DBG_BRWD
2013-03-20core: add str::each{,i}_reverseErick Tryzelaar-76/+214
2013-03-20core: add char_len methodErick Tryzelaar-1/+5
2013-03-20core: add char_at_reverseErick Tryzelaar-1/+34
2013-03-18librustc: Convert all uses of old lifetime notation to new lifetime ↵Patrick Walton-35/+35
notation. rs=delifetiming
2013-03-15auto merge of #5404 : bstrie/rust/decopy, r=pcwaltonbors-0/+8
Also turn `copy` into `.clone()` in much of run-pass.
2013-03-15impl Clone for ~T, ~[T], ~strBen Striegel-0/+8