about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuri Astrakhan <YuriAstrakhan@gmail.com>2025-01-11 02:56:58 -0500
committerYuri Astrakhan <YuriAstrakhan@gmail.com>2025-01-11 02:56:58 -0500
commit86b86fa8fb89aca91aa176a0727b9f233cd14353 (patch)
tree8965d35dc01198bdd5faa3f52d25be4cc8f99695
parent2f5a3d4b06a0a9e8749c2e361758ec517df0c96a (diff)
downloadrust-86b86fa8fb89aca91aa176a0727b9f233cd14353.tar.gz
rust-86b86fa8fb89aca91aa176a0727b9f233cd14353.zip
Rename `pos` to `position`
-rw-r--r--library/core/src/ffi/c_str.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs
index 63915c35288..7180593edf0 100644
--- a/library/core/src/ffi/c_str.rs
+++ b/library/core/src/ffi/c_str.rs
@@ -127,10 +127,10 @@ pub struct CStr {
 #[derive(Clone, Copy, PartialEq, Eq, Debug)]
 #[stable(feature = "core_c_str", since = "1.64.0")]
 pub enum FromBytesWithNulError {
-    /// Data provided contains an interior nul byte at byte `pos`.
+    /// Data provided contains an interior nul byte at byte `position`.
     InteriorNul {
         /// The position of the interior nul byte.
-        pos: usize,
+        position: usize,
     },
     /// Data provided is not nul terminated.
     NotNulTerminated,
@@ -187,8 +187,8 @@ impl fmt::Display for FromBytesWithNulError {
     #[allow(deprecated, deprecated_in_future)]
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         f.write_str(self.description())?;
-        if let Self::InteriorNul { pos } = self {
-            write!(f, " at byte pos {pos}")?;
+        if let Self::InteriorNul { position } = self {
+            write!(f, " at byte pos {position}")?;
         }
         Ok(())
     }
@@ -355,7 +355,7 @@ impl CStr {
     /// use std::ffi::{CStr, FromBytesWithNulError};
     ///
     /// let cstr = CStr::from_bytes_with_nul(b"he\0llo\0");
-    /// assert_eq!(cstr, Err(FromBytesWithNulError::InteriorNul { pos: 2 }));
+    /// assert_eq!(cstr, Err(FromBytesWithNulError::InteriorNul { position: 2 }));
     /// ```
     #[stable(feature = "cstr_from_bytes", since = "1.10.0")]
     #[rustc_const_stable(feature = "const_cstr_methods", since = "1.72.0")]
@@ -367,7 +367,7 @@ impl CStr {
                 // of the byte slice.
                 Ok(unsafe { Self::from_bytes_with_nul_unchecked(bytes) })
             }
-            Some(pos) => Err(FromBytesWithNulError::InteriorNul { pos }),
+            Some(position) => Err(FromBytesWithNulError::InteriorNul { position }),
             None => Err(FromBytesWithNulError::NotNulTerminated),
         }
     }