cc80652e4a
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) |
||
---|---|---|
.. | ||
_match.rs | ||
adt.rs | ||
asm.rs | ||
base.rs | ||
block.rs | ||
build.rs | ||
cabi_arm.rs | ||
cabi_mips.rs | ||
cabi_x86_64.rs | ||
cabi_x86.rs | ||
cabi.rs | ||
callee.rs | ||
closure.rs | ||
common.rs | ||
consts.rs | ||
controlflow.rs | ||
datum.rs | ||
debuginfo.rs | ||
expr.rs | ||
foreign.rs | ||
glue.rs | ||
inline.rs | ||
machine.rs | ||
macros.rs | ||
meth.rs | ||
monomorphize.rs | ||
reachable.rs | ||
reflect.rs | ||
shape.rs | ||
tvec.rs | ||
type_of.rs | ||
type_use.rs | ||
uniq.rs | ||
write_guard.rs |