Skip to content

Commit e4a3ed2

Browse files
nyurikgitbot
authored and
gitbot
committed
Rename pos to position
1 parent 82e58df commit e4a3ed2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/src/ffi/c_str.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ pub struct CStr {
127127
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
128128
#[stable(feature = "core_c_str", since = "1.64.0")]
129129
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`.
131131
InteriorNul {
132132
/// The position of the interior nul byte.
133-
pos: usize,
133+
position: usize,
134134
},
135135
/// Data provided is not nul terminated.
136136
NotNulTerminated,
@@ -187,8 +187,8 @@ impl fmt::Display for FromBytesWithNulError {
187187
#[allow(deprecated, deprecated_in_future)]
188188
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
189189
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}")?;
192192
}
193193
Ok(())
194194
}
@@ -355,7 +355,7 @@ impl CStr {
355355
/// use std::ffi::{CStr, FromBytesWithNulError};
356356
///
357357
/// 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 }));
359359
/// ```
360360
#[stable(feature = "cstr_from_bytes", since = "1.10.0")]
361361
#[rustc_const_stable(feature = "const_cstr_methods", since = "1.72.0")]
@@ -367,7 +367,7 @@ impl CStr {
367367
// of the byte slice.
368368
Ok(unsafe { Self::from_bytes_with_nul_unchecked(bytes) })
369369
}
370-
Some(pos) => Err(FromBytesWithNulError::InteriorNul { pos }),
370+
Some(position) => Err(FromBytesWithNulError::InteriorNul { position }),
371371
None => Err(FromBytesWithNulError::NotNulTerminated),
372372
}
373373
}

0 commit comments

Comments
 (0)