diff options
| author | bors <bors@rust-lang.org> | 2013-06-11 21:37:43 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-11 21:37:43 -0700 |
| commit | cc80652e4a627378a36b50fab9e72349129cb56a (patch) | |
| tree | ada1e23e714b7dc587d86aeddb54a954dded8f3a /src/rt/rust_task.cpp | |
| parent | 7033dfcf917ccef44fbc3e33d31814455c13b4c6 (diff) | |
| parent | 9f0c85acc967110c85f9a8bdcb32df4606a6dff5 (diff) | |
| download | rust-cc80652e4a627378a36b50fab9e72349129cb56a.tar.gz rust-cc80652e4a627378a36b50fab9e72349129cb56a.zip | |
auto merge of #7060 : huonw/rust/more-str, r=thestinger
There are now only half-a-dozen or so functions left `std::str` that should be methods. Highlights: - `.substr` was removed, since most of the uses of it in the code base were actually incorrect (it had a weird mixing of a byte index and a unicode character count), adding `.slice_chars` if one wants to handle characters, and the normal `.slice` method to handle bytes. - Code duplication between the two impls for `connect` and `concat` was removed via a new `Str` trait, that is purely designed to allow an explicit -> `&str` conversion (`.as_slice()`) - Deconfuse the 5 different functions for converting to `[u8]` (3 of which had actually incorrect documentation: implying that they didn't have the null terminator), into 3: `as_bytes` (all strings), `as_bytes_with_null` (`&'static str`, `@str` and `~str`) and `as_bytes_with_null_consume` (`~str`). None of these allocate, unlike the old versions. (cc @thestinger)
Diffstat (limited to 'src/rt/rust_task.cpp')
0 files changed, 0 insertions, 0 deletions
