about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-01-22 12:19:11 +0000
committerbors <bors@rust-lang.org>2017-01-22 12:19:11 +0000
commit3ddc27025229c01bd1aeab9da3ebe34e3046da58 (patch)
tree46b387e725b989ffbbf82b66d5139fc337985c0d /src/libstd
parent98c3128c3933fe2c39c46eb542a53705783af9a1 (diff)
parent27123d1a2a4e91ff5b163b5eb0c0b8e2b10dea57 (diff)
downloadrust-3ddc27025229c01bd1aeab9da3ebe34e3046da58.tar.gz
rust-3ddc27025229c01bd1aeab9da3ebe34e3046da58.zip
Auto merge of #39224 - GuillaumeGomez:os_string_urls, r=frewsxcv
Add missing urls for OsStr and OsString

r? @frewsxcv
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ffi/os_str.rs37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs
index 813a5f03646..273b717f467 100644
--- a/src/libstd/ffi/os_str.rs
+++ b/src/libstd/ffi/os_str.rs
@@ -31,16 +31,20 @@ use sys_common::{AsInner, IntoInner, FromInner};
 ///
 /// * In Rust, strings are always valid UTF-8, but may contain zeros.
 ///
-/// `OsString` and `OsStr` bridge this gap by simultaneously representing Rust
+/// `OsString` and [`OsStr`] bridge this gap by simultaneously representing Rust
 /// and platform-native string values, and in particular allowing a Rust string
 /// to be converted into an "OS" string with no cost.
+///
+/// [`OsStr`]: struct.OsStr.html
 #[derive(Clone)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct OsString {
     inner: Buf
 }
 
-/// Slices into OS strings (see `OsString`).
+/// Slices into OS strings (see [`OsString`]).
+///
+/// [`OsString`]: struct.OsString.html
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct OsStr {
     inner: Slice
@@ -61,7 +65,9 @@ impl OsString {
         OsString { inner: Buf::from_string(String::new()) }
     }
 
-    /// Converts to an `OsStr` slice.
+    /// Converts to an [`OsStr`] slice.
+    ///
+    /// [`OsStr`]: struct.OsStr.html
     ///
     /// # Examples
     ///
@@ -77,10 +83,12 @@ impl OsString {
         self
     }
 
-    /// Converts the `OsString` into a `String` if it contains valid Unicode data.
+    /// Converts the `OsString` into a [`String`] if it contains valid Unicode data.
     ///
     /// On failure, ownership of the original `OsString` is returned.
     ///
+    /// [`String`]: ../../std/string/struct.String.html
+    ///
     /// # Examples
     ///
     /// ```
@@ -95,7 +103,9 @@ impl OsString {
         self.inner.into_string().map_err(|buf| OsString { inner: buf} )
     }
 
-    /// Extends the string with the given `&OsStr` slice.
+    /// Extends the string with the given [`&OsStr`] slice.
+    ///
+    /// [`&OsStr`]: struct.OsStr.html
     ///
     /// # Examples
     ///
@@ -329,10 +339,12 @@ impl OsStr {
         unsafe { mem::transmute(inner) }
     }
 
-    /// Yields a `&str` slice if the `OsStr` is valid Unicode.
+    /// Yields a [`&str`] slice if the `OsStr` is valid Unicode.
     ///
     /// This conversion may entail doing a check for UTF-8 validity.
     ///
+    /// [`&str`]: ../../std/primitive.str.html
+    ///
     /// # Examples
     ///
     /// ```
@@ -346,10 +358,13 @@ impl OsStr {
         self.inner.to_str()
     }
 
-    /// Converts an `OsStr` to a `Cow<str>`.
+    /// Converts an `OsStr` to a [`Cow`]`<`[`str`]`>`.
     ///
     /// Any non-Unicode sequences are replaced with U+FFFD REPLACEMENT CHARACTER.
     ///
+    /// [`Cow`]: ../../std/borrow/enum.Cow.html
+    /// [`str`]: ../../std/primitive.str.html
+    ///
     /// # Examples
     ///
     /// Calling `to_string_lossy` on an `OsStr` with valid unicode:
@@ -368,7 +383,9 @@ impl OsStr {
         self.inner.to_string_lossy()
     }
 
-    /// Copies the slice into an owned `OsString`.
+    /// Copies the slice into an owned [`OsString`].
+    ///
+    /// [`OsString`]: struct.OsString.html
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn to_os_string(&self) -> OsString {
         OsString { inner: self.inner.to_owned() }
@@ -397,10 +414,12 @@ impl 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`
     /// rather than a list of bytes. This number is simply useful for passing to
-    /// other methods like `OsString::with_capacity` to avoid reallocations.
+    /// other methods like [`OsString::with_capacity`] to avoid reallocations.
     ///
     /// See `OsStr` introduction for more information about encoding.
     ///
+    /// [`OsString::with_capacity`]: struct.OsString.html#method.with_capacity
+    ///
     /// # Examples
     ///
     /// ```