std: Stabilize APIs for the 1.8 release
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
This commit is contained in:
parent
504ca6f422
commit
b643782a10
52 changed files with 203 additions and 227 deletions
|
@ -56,7 +56,7 @@ fn write(out: &Output, data: &[u8]) -> io::Result<usize> {
|
|||
Output::Pipe(ref p) => return p.get().write(data),
|
||||
};
|
||||
let utf16 = match str::from_utf8(data).ok() {
|
||||
Some(utf8) => utf8.utf16_units().collect::<Vec<u16>>(),
|
||||
Some(utf8) => utf8.encode_utf16().collect::<Vec<u16>>(),
|
||||
None => return Err(invalid_encoding()),
|
||||
};
|
||||
let mut written = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue