mozilla/rust — pull request #7060 by huonw (2013-06-11 16:13:09+00:00)
Title: More str method conversion and cleanup.

There are now only half-a-dozen or so functions left in that should be methods.

Highlights:
- `.substr` was removed, since most of the uses of it were actually incorrect, leaving `.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).