1
Fork 0

Stabilize std::char::{encode_utf8, encode_utf16}

This commit is contained in:
Aaron Turon 2016-12-14 12:34:02 -08:00
parent b02ed1e1d4
commit 415f3de7aa
2 changed files with 4 additions and 12 deletions

View file

@ -327,9 +327,9 @@ pub trait CharExt {
fn len_utf8(self) -> usize; fn len_utf8(self) -> usize;
#[stable(feature = "core", since = "1.6.0")] #[stable(feature = "core", since = "1.6.0")]
fn len_utf16(self) -> usize; fn len_utf16(self) -> usize;
#[unstable(feature = "unicode", issue = "27784")] #[stable(feature = "unicode_encode_char", since = "1.15.0")]
fn encode_utf8(self, dst: &mut [u8]) -> &mut str; fn encode_utf8(self, dst: &mut [u8]) -> &mut str;
#[unstable(feature = "unicode", issue = "27784")] #[stable(feature = "unicode_encode_char", since = "1.15.0")]
fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16]; fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16];
} }

View file

@ -448,8 +448,6 @@ impl char {
/// In both of these examples, 'ß' takes two bytes to encode. /// In both of these examples, 'ß' takes two bytes to encode.
/// ///
/// ``` /// ```
/// #![feature(unicode)]
///
/// let mut b = [0; 2]; /// let mut b = [0; 2];
/// ///
/// let result = 'ß'.encode_utf8(&mut b); /// let result = 'ß'.encode_utf8(&mut b);
@ -474,9 +472,7 @@ impl char {
/// ///
/// assert!(result.is_err()); /// assert!(result.is_err());
/// ``` /// ```
#[unstable(feature = "unicode", #[stable(feature = "unicode_encode_char", since = "1.15.0")]
reason = "pending decision about Iterator/Writer/Reader",
issue = "27784")]
#[inline] #[inline]
pub fn encode_utf8(self, dst: &mut [u8]) -> &mut str { pub fn encode_utf8(self, dst: &mut [u8]) -> &mut str {
C::encode_utf8(self, dst) C::encode_utf8(self, dst)
@ -495,8 +491,6 @@ impl char {
/// In both of these examples, '𝕊' takes two `u16`s to encode. /// In both of these examples, '𝕊' takes two `u16`s to encode.
/// ///
/// ``` /// ```
/// #![feature(unicode)]
///
/// let mut b = [0; 2]; /// let mut b = [0; 2];
/// ///
/// let result = '𝕊'.encode_utf16(&mut b); /// let result = '𝕊'.encode_utf16(&mut b);
@ -519,9 +513,7 @@ impl char {
/// ///
/// assert!(result.is_err()); /// assert!(result.is_err());
/// ``` /// ```
#[unstable(feature = "unicode", #[stable(feature = "unicode_encode_char", since = "1.15.0")]
reason = "pending decision about Iterator/Writer/Reader",
issue = "27784")]
#[inline] #[inline]
pub fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16] { pub fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16] {
C::encode_utf16(self, dst) C::encode_utf16(self, dst)