]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #41258 - clarcharr:str_box_extras, r=Kimundi
authorbors <bors@rust-lang.org>
Wed, 26 Apr 2017 06:18:17 +0000 (06:18 +0000)
committerbors <bors@rust-lang.org>
Wed, 26 Apr 2017 06:18:17 +0000 (06:18 +0000)
More methods for str boxes. (reduce Box<[u8]> ↔ Box<str> transmutes)

This is a follow-up to #41096 that adds safer methods for converting between `Box<str>` and `Box<[u8]>`. They're gated under a different feature from the `&mut str` methods because they may be too niche to include in public APIs, although having them internally helps reduce the number of transmutes the standard library uses.

What's added:

* `From<Box<str>> for Box<[u8]>`
* `<Box<str>>::into_boxed_bytes` (just calls `Into::into`)
* `alloc::str` (new module)
* `from_boxed_utf8` and `from_boxed_utf8_unchecked`, defined in `alloc:str`, exported in `collections::str`
* exports `from_utf8_mut` in `collections::str` (missed from previous PR)

1  2 
src/doc/unstable-book/src/SUMMARY.md
src/liballoc/lib.rs
src/libcollections/lib.rs
src/libcollections/string.rs

Simple merge
Simple merge
Simple merge
Simple merge