We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
std::ffi::NulError::into_vec
1 parent 444ff9f commit 0a6b862Copy full SHA for 0a6b862
src/libstd/ffi/c_str.rs
@@ -373,6 +373,15 @@ impl NulError {
373
374
/// Consumes this error, returning the underlying vector of bytes which
375
/// generated the error in the first place.
376
+ ///
377
+ /// # Examples
378
379
+ /// ```
380
+ /// use std::ffi::CString;
381
382
+ /// let nul_error = CString::new("foo\0bar").unwrap_err();
383
+ /// assert_eq!(nul_error.into_vec(), b"foo\0bar");
384
385
#[stable(feature = "rust1", since = "1.0.0")]
386
pub fn into_vec(self) -> Vec<u8> { self.1 }
387
}
0 commit comments