@@ -208,11 +208,12 @@ pub struct CStr {
208
208
inner : [ c_char ]
209
209
}
210
210
211
- /// An error returned from [`CString::new`] to indicate that a nul byte was found
212
- /// in the vector provided. While Rust strings may contain nul bytes in the middle,
213
- /// C strings can't, as that byte would effectively truncate the string.
211
+ /// An error indicating that an interior nul byte was found.
214
212
///
215
- /// This `struct` is created by the [`new`][`CString::new`] method on
213
+ /// While Rust strings may contain nul bytes in the middle, C strings
214
+ /// can't, as that byte would effectively truncate the string.
215
+ ///
216
+ /// This error is created by the [`new`][`CString::new`] method on
216
217
/// [`CString`]. See its documentation for more.
217
218
///
218
219
/// [`CString`]: struct.CString.html
@@ -229,13 +230,12 @@ pub struct CStr {
229
230
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
230
231
pub struct NulError ( usize , Vec < u8 > ) ;
231
232
232
- /// An error returned from [`CStr::from_bytes_with_nul`] to indicate
233
- /// that a nul byte was found too early in the slice provided, or one
234
- /// wasn't found at all for the nul terminator. The slice used to
235
- /// create a `CStr` must have one and only one nul byte at the end of
236
- /// the slice.
233
+ /// An error indicating that a nul byte was not in the expected position.
237
234
///
238
- /// This `struct` is created by the
235
+ /// The slice used to create a [`CStr`] must have one and only one nul
236
+ /// byte at the end of the slice.
237
+ ///
238
+ /// This error is created by the
239
239
/// [`from_bytes_with_nul`][`CStr::from_bytes_with_nul`] method on
240
240
/// [`CStr`]. See its documentation for more.
241
241
///
@@ -274,16 +274,17 @@ impl FromBytesWithNulError {
274
274
}
275
275
}
276
276
277
- /// An error returned from [`CString::into_string `] to indicate that a
278
- /// UTF-8 error was encountered during the conversion. `CString` is
279
- /// just a wrapper over a buffer of bytes with a nul terminator;
280
- /// [`into_string`][`CString::into_string`] performs UTF-8 validation
281
- /// and may return this error.
277
+ /// An error indicating invalid UTF-8 when converting a [`CString`] into a [`String`].
278
+ ///
279
+ /// `CString` is just a wrapper over a buffer of bytes with a nul
280
+ /// terminator; [`into_string`][`CString::into_string`] performs UTF-8
281
+ /// validation on those bytes and may return this error.
282
282
///
283
283
/// This `struct` is created by the
284
284
/// [`into_string`][`CString::into_string`] method on [`CString`]. See
285
285
/// its documentation for more.
286
286
///
287
+ /// [`String`]: ../string/struct.String.html
287
288
/// [`CString`]: struct.CString.html
288
289
/// [`CString::into_string`]: struct.CString.html#method.into_string
289
290
#[ derive( Clone , PartialEq , Eq , Debug ) ]
0 commit comments