mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +00:00
Add doc example for NulError
.
This commit is contained in:
parent
e52d2f2ad0
commit
4797d8446c
|
@ -152,6 +152,14 @@ pub struct CStr {
|
|||
/// in the vector provided.
|
||||
///
|
||||
/// [`CString::new`]: struct.CString.html#method.new
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::ffi::{CString, NulError};
|
||||
///
|
||||
/// let _: NulError = CString::new(b"f\0oo".to_vec()).unwrap_err();
|
||||
/// ```
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct NulError(usize, Vec<u8>);
|
||||
|
|
Loading…
Reference in a new issue