about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2015-08-13 18:39:46 +0200
committerSimon Sapin <simon.sapin@exyr.org>2015-08-23 00:28:56 +0200
commit6174b8d726ed5764694e5404329d8b5e66517ed5 (patch)
tree47dd9d787f7550a5d47301652fc5081446f6495e /src/libstd/sys/unix/stack_overflow.rs
parentc408b7863389aa2bdb253ffa363e693bcd02439f (diff)
downloadrust-6174b8d726ed5764694e5404329d8b5e66517ed5.tar.gz
rust-6174b8d726ed5764694e5404329d8b5e66517ed5.zip
Refactor low-level UTF-16 decoding.
* Rename `utf16_items` to `decode_utf16`. "Items" is meaningless.
* Move it to `rustc_unicode::char`, exposed in `std::char`.
* Generalize it to any `u16` iterable, not just `&[u16]`.
* Make it yield `Result` instead of a custom `Utf16Item` enum that was isomorphic to `Result`. This enable using the `FromIterator for Result` impl.
* Add a `REPLACEMENT_CHARACTER` constant.
* Document how `result.unwrap_or(REPLACEMENT_CHARACTER)` replaces `Utf16Item::to_char_lossy`.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions