Skip to content

Commit 1d3b7b4

Browse files
committed
Fix documentation
1 parent 897fc9f commit 1d3b7b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/c_string.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,10 @@ pub enum ExtendError {
340340
/// The capacity of the [`CString`] is too small.
341341
Capacity(CapacityError),
342342
/// An invalid interior nul byte found in a given byte slice.
343-
InteriorNul { position: usize },
343+
InteriorNul {
344+
/// A position of a nul byte.
345+
position: usize,
346+
},
344347
}
345348

346349
impl Error for ExtendError {}
@@ -397,7 +400,7 @@ mod tests {
397400
// Call must fail since `w\0rld` contains an interior nul byte.
398401
assert!(matches!(
399402
c_string.extend_from_bytes(b"w\0rld"),
400-
Err(ExtendError::InteriorNul(1))
403+
Err(ExtendError::InteriorNul { position: 1 })
401404
));
402405

403406
// However, the call above _must not_ have invalidated the state of our CString

0 commit comments

Comments
 (0)