File tree 1 file changed +11
-6
lines changed 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -590,14 +590,19 @@ impl OsStr {
590
590
591
591
/// Returns the length of this `OsStr`.
592
592
///
593
- /// Note that this does **not** return the number of bytes in this string
594
- /// as, for example, OS strings on Windows are encoded as a list of [`u16`]
595
- /// rather than a list of bytes. This number is simply useful for passing to
596
- /// other methods like [`OsString::with_capacity`] to avoid reallocations.
593
+ /// Note that this does **not** return the number of bytes in the string in
594
+ /// OS string form.
597
595
///
598
- /// See `OsStr` introduction for more information about encoding.
596
+ /// The length returned is that of the underlying storage used by `OsStr`;
597
+ /// As discussed in the [`OsString`] introduction, [`OsString`] and `OsStr`
598
+ /// store strings in a form best suited for cheap inter-conversion between
599
+ /// native-platform and Rust string forms, which may differ significantly
600
+ /// from both of them, including in storage size and encoding.
599
601
///
600
- /// [`u16`]: ../primitive.u16.html
602
+ /// This number is simply useful for passing to other methods, like
603
+ /// [`OsString::with_capacity`] to avoid reallocations.
604
+ ///
605
+ /// [`OsString`]: struct.OsString.html
601
606
/// [`OsString::with_capacity`]: struct.OsString.html#method.with_capacity
602
607
///
603
608
/// # Examples
You can’t perform that action at this time.
0 commit comments