Rollup merge of - frewsxcv:into-vec, r=GuillaumeGomez

Add doc example for `std::ffi::NulError::into_vec`.

None
This commit is contained in:
Jonathan Turner 2016-08-07 09:59:44 -07:00 committed by GitHub
commit 3917d0e033

@ -373,6 +373,15 @@ impl NulError {
/// Consumes this error, returning the underlying vector of bytes which
/// generated the error in the first place.
///
/// # Examples
///
/// ```
/// use std::ffi::CString;
///
/// let nul_error = CString::new("foo\0bar").unwrap_err();
/// assert_eq!(nul_error.into_vec(), b"foo\0bar");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn into_vec(self) -> Vec<u8> { self.1 }
}