Skip to content

Commit 3e2989b

Browse files
Rollup merge of #42198 - GuillaumeGomez:os-str-doc, r=QuietMisdreavus
Add missing urls for OsStr docs r? @rust-lang/docs
2 parents 8d0ebd4 + 55c3f0b commit 3e2989b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/libstd/ffi/os_str.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ impl OsString {
247247
self.inner.shrink_to_fit()
248248
}
249249

250-
/// Converts this `OsString` into a boxed `OsStr`.
250+
/// Converts this `OsString` into a boxed [`OsStr`].
251+
///
252+
/// [`OsStr`]: struct.OsStr.html
251253
///
252254
/// # Examples
253255
///
@@ -482,12 +484,13 @@ impl OsStr {
482484
/// Returns the length of this `OsStr`.
483485
///
484486
/// Note that this does **not** return the number of bytes in this string
485-
/// as, for example, OS strings on Windows are encoded as a list of `u16`
487+
/// as, for example, OS strings on Windows are encoded as a list of [`u16`]
486488
/// rather than a list of bytes. This number is simply useful for passing to
487489
/// other methods like [`OsString::with_capacity`] to avoid reallocations.
488490
///
489491
/// See `OsStr` introduction for more information about encoding.
490492
///
493+
/// [`u16`]: ../primitive.u16.html
491494
/// [`OsString::with_capacity`]: struct.OsString.html#method.with_capacity
492495
///
493496
/// # Examples
@@ -506,7 +509,10 @@ impl OsStr {
506509
self.inner.inner.len()
507510
}
508511

509-
/// Converts a `Box<OsStr>` into an `OsString` without copying or allocating.
512+
/// Converts a [`Box`]`<OsStr>` into an [`OsString`] without copying or allocating.
513+
///
514+
/// [`Box`]: ../boxed/struct.Box.html
515+
/// [`OsString`]: struct.OsString.html
510516
#[unstable(feature = "into_boxed_os_str", issue = "40380")]
511517
pub fn into_os_string(self: Box<OsStr>) -> OsString {
512518
let inner: Box<Slice> = unsafe { mem::transmute(self) };

0 commit comments

Comments
 (0)