File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,10 @@ pub enum ExtendError {
340
340
/// The capacity of the [`CString`] is too small.
341
341
Capacity ( CapacityError ) ,
342
342
/// 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
+ } ,
344
347
}
345
348
346
349
impl Error for ExtendError { }
@@ -397,7 +400,7 @@ mod tests {
397
400
// Call must fail since `w\0rld` contains an interior nul byte.
398
401
assert ! ( matches!(
399
402
c_string. extend_from_bytes( b"w\0 rld" ) ,
400
- Err ( ExtendError :: InteriorNul ( 1 ) )
403
+ Err ( ExtendError :: InteriorNul { position : 1 } )
401
404
) ) ;
402
405
403
406
// However, the call above _must not_ have invalidated the state of our CString
You can’t perform that action at this time.
0 commit comments