]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #42198 - GuillaumeGomez:os-str-doc, r=QuietMisdreavus
authorMark Simulacrum <mark.simulacrum@gmail.com>
Thu, 25 May 2017 01:50:10 +0000 (19:50 -0600)
committerGitHub <noreply@github.com>
Thu, 25 May 2017 01:50:10 +0000 (19:50 -0600)
Add missing urls for OsStr docs

r? @rust-lang/docs

src/libstd/ffi/os_str.rs

index f497734e249c5c5d9c0cc3e5628cb85f014ba38e..a5a1b5e5f09191a62c25e3bd04b95335cb9b3f48 100644 (file)
@@ -247,7 +247,9 @@ pub fn shrink_to_fit(&mut self) {
         self.inner.shrink_to_fit()
     }
 
-    /// Converts this `OsString` into a boxed `OsStr`.
+    /// Converts this `OsString` into a boxed [`OsStr`].
+    ///
+    /// [`OsStr`]: struct.OsStr.html
     ///
     /// # Examples
     ///
@@ -482,12 +484,13 @@ pub fn is_empty(&self) -> bool {
     /// Returns the length of this `OsStr`.
     ///
     /// Note that this does **not** return the number of bytes in this string
-    /// as, for example, OS strings on Windows are encoded as a list of `u16`
+    /// as, for example, OS strings on Windows are encoded as a list of [`u16`]
     /// rather than a list of bytes. This number is simply useful for passing to
     /// other methods like [`OsString::with_capacity`] to avoid reallocations.
     ///
     /// See `OsStr` introduction for more information about encoding.
     ///
+    /// [`u16`]: ../primitive.u16.html
     /// [`OsString::with_capacity`]: struct.OsString.html#method.with_capacity
     ///
     /// # Examples
@@ -506,7 +509,10 @@ pub fn len(&self) -> usize {
         self.inner.inner.len()
     }
 
-    /// Converts a `Box<OsStr>` into an `OsString` without copying or allocating.
+    /// Converts a [`Box`]`<OsStr>` into an [`OsString`] without copying or allocating.
+    ///
+    /// [`Box`]: ../boxed/struct.Box.html
+    /// [`OsString`]: struct.OsString.html
     #[unstable(feature = "into_boxed_os_str", issue = "40380")]
     pub fn into_os_string(self: Box<OsStr>) -> OsString {
         let inner: Box<Slice> = unsafe { mem::transmute(self) };