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.
FromBytesWithNulError
1 parent 4797d84 commit d3c26feCopy full SHA for d3c26fe
src/libstd/ffi/c_str.rs
@@ -168,6 +168,14 @@ pub struct NulError(usize, Vec<u8>);
168
/// byte was found too early in the slice provided or one wasn't found at all.
169
///
170
/// [`CStr::from_bytes_with_nul`]: struct.CStr.html#method.from_bytes_with_nul
171
+///
172
+/// # Examples
173
174
+/// ```
175
+/// use std::ffi::{CStr, FromBytesWithNulError};
176
177
+/// let _: FromBytesWithNulError = CStr::from_bytes_with_nul(b"f\0oo").unwrap_err();
178
179
#[derive(Clone, PartialEq, Eq, Debug)]
180
#[stable(feature = "cstr_from_bytes", since = "1.10.0")]
181
pub struct FromBytesWithNulError {
0 commit comments