]> git.lizzy.rs Git - rust.git/commit
std: Change `encode_utf{8,16}` to return iterators
authorAlex Crichton <alex@alexcrichton.com>
Fri, 11 Mar 2016 19:01:46 +0000 (11:01 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 22 Mar 2016 17:25:30 +0000 (10:25 -0700)
commit48d5fe9ec560b53b1f5069219b0d62015e1de5ba
tree94f12e261a6d8513968aee2ad8cbb965fdecdf86
parentc7bdfd4442f0bde3412f08336f75b9eabff4a938
std: Change `encode_utf{8,16}` to return iterators

Currently these have non-traditional APIs which take a buffer and report how
much was filled in, but they're not necessarily ergonomic to use. Returning an
iterator which *also* exposes an underlying slice shouldn't result in any
performance loss as it's just a lazy version of the same implementation, and
it's also much more ergonomic!

cc #27784
src/libcollections/string.rs
src/libcollectionstest/str.rs
src/libcore/char.rs
src/libcore/fmt/mod.rs
src/libcoretest/char.rs
src/librustc_unicode/char.rs
src/librustc_unicode/lib.rs
src/librustc_unicode/u_str.rs
src/libserialize/json.rs
src/libstd/sys/common/wtf8.rs