@@ -127,10 +127,10 @@ pub struct CStr {
127
127
#[ derive( Clone , Copy , PartialEq , Eq , Debug ) ]
128
128
#[ stable( feature = "core_c_str" , since = "1.64.0" ) ]
129
129
pub enum FromBytesWithNulError {
130
- /// Data provided contains an interior nul byte at byte `pos `.
130
+ /// Data provided contains an interior nul byte at byte `position `.
131
131
InteriorNul {
132
132
/// The position of the interior nul byte.
133
- pos : usize ,
133
+ position : usize ,
134
134
} ,
135
135
/// Data provided is not nul terminated.
136
136
NotNulTerminated ,
@@ -187,8 +187,8 @@ impl fmt::Display for FromBytesWithNulError {
187
187
#[ allow( deprecated, deprecated_in_future) ]
188
188
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
189
189
f. write_str ( self . description ( ) ) ?;
190
- if let Self :: InteriorNul { pos } = self {
191
- write ! ( f, " at byte pos {pos }" ) ?;
190
+ if let Self :: InteriorNul { position } = self {
191
+ write ! ( f, " at byte pos {position }" ) ?;
192
192
}
193
193
Ok ( ( ) )
194
194
}
@@ -355,7 +355,7 @@ impl CStr {
355
355
/// use std::ffi::{CStr, FromBytesWithNulError};
356
356
///
357
357
/// let cstr = CStr::from_bytes_with_nul(b"he\0llo\0");
358
- /// assert_eq!(cstr, Err(FromBytesWithNulError::InteriorNul { pos : 2 }));
358
+ /// assert_eq!(cstr, Err(FromBytesWithNulError::InteriorNul { position : 2 }));
359
359
/// ```
360
360
#[ stable( feature = "cstr_from_bytes" , since = "1.10.0" ) ]
361
361
#[ rustc_const_stable( feature = "const_cstr_methods" , since = "1.72.0" ) ]
@@ -367,7 +367,7 @@ impl CStr {
367
367
// of the byte slice.
368
368
Ok ( unsafe { Self :: from_bytes_with_nul_unchecked ( bytes) } )
369
369
}
370
- Some ( pos ) => Err ( FromBytesWithNulError :: InteriorNul { pos } ) ,
370
+ Some ( position ) => Err ( FromBytesWithNulError :: InteriorNul { position } ) ,
371
371
None => Err ( FromBytesWithNulError :: NotNulTerminated ) ,
372
372
}
373
373
}
0 commit comments