]> git.lizzy.rs Git - rust.git/commit
std::str: remove .as_mut_buf & rewrite/simplify `.push_char`.
authorHuon Wilson <dbau.pp+github@gmail.com>
Tue, 17 Dec 2013 15:46:26 +0000 (02:46 +1100)
committerHuon Wilson <dbau.pp+github@gmail.com>
Wed, 18 Dec 2013 23:18:02 +0000 (10:18 +1100)
commitb906a8b256e8e7a289bb7b0e4382f30c4bd0f431
tree2b05006e2479b7597f7fad5eba61e9904ec602cd
parent17ac2aa523f03c386669f569bc89019deb0c0ecd
std::str: remove .as_mut_buf & rewrite/simplify `.push_char`.

`.as_mut_buf` was used exactly once, in `.push_char` which could be
written in a simpler way, using the `&mut ~[u8]` that it already
retrieved. In the rare situation when someone really needs
`.as_mut_buf`-like functionality (getting a `*mut u8`), they can go via
`str::raw::as_owned_vec`.
src/libstd/str.rs