Stabilise FromUtf8Error::as_bytes

Closes #40895.
This commit is contained in:
varkor 2018-03-17 21:41:14 +00:00
parent adf2135adc
commit b57ea56159

View file

@ -1576,7 +1576,6 @@ impl FromUtf8Error {
/// Basic usage:
///
/// ```
/// #![feature(from_utf8_error_as_bytes)]
/// // some invalid bytes, in a vector
/// let bytes = vec![0, 159];
///
@ -1584,7 +1583,7 @@ impl FromUtf8Error {
///
/// assert_eq!(&[0, 159], value.unwrap_err().as_bytes());
/// ```
#[unstable(feature = "from_utf8_error_as_bytes", reason = "recently added", issue = "40895")]
#[stable(feature = "from_utf8_error_as_bytes", since = "1.26.0")]
pub fn as_bytes(&self) -> &[u8] {
&self.bytes[..]
}