]> git.lizzy.rs Git - rust.git/commit
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)
commitdad9814eb0964a92494fef9ce23b80353dc14c46
tree4d2fa1e7f6cbdf2c7606bceea1cc8c09a6660239
parent4512424391768cfad54efb8ccdb1191f61e338c2
parentc66c6e96978cd81130587e9f4d1fa52dc1b183d6
Auto merge of #41258 - clarcharr:str_box_extras, r=Kimundi

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)
src/doc/unstable-book/src/SUMMARY.md
src/liballoc/lib.rs
src/libcollections/lib.rs
src/libcollections/string.rs