diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 9b5e5d6c0cc4b..bdfe2e625926a 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -188,6 +188,14 @@ impl OsString { /// /// See main `OsString` documentation information about encoding. /// + /// # Notes + /// + /// `capacity` represents the length of the units in the given `OsString`, + /// which is different from the size of "Rust string form" like `String` or + /// `str`. Also, they could be different on different platforms. + /// + /// Refer to [`OsString`] for more details. + /// /// # Examples /// /// ``` @@ -272,6 +280,14 @@ impl OsString { /// greater than or equal to `self.len() + additional`. Does nothing if /// capacity is already sufficient. /// + /// # Notes + /// + /// `additional` represents the length of the units in the given `OsString`, + /// which is different from the size of "Rust string form" like `String` or + /// `str`. Also, they could be different on different platforms. + /// + /// Refer to [`OsString`] for more details. + /// /// # Errors /// /// If the capacity overflows, or the allocator reports a failure, then an error