From fc825f09e87c11413ae1e6a28957df055eb92b96 Mon Sep 17 00:00:00 2001 From: muvlon Date: Thu, 11 Jan 2018 17:20:16 +0100 Subject: [PATCH 1/3] Fix confusing documentation for OsStr --- src/libstd/ffi/os_str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 109173d31c501..0d07c01a105e2 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -84,7 +84,7 @@ pub struct OsString { /// This type represents a borrowed reference to a string in the operating system's preferred /// representation. /// -/// `OsStr` is to [`OsString`] as [`String`] is to [`&str`]: the former in each pair are borrowed +/// `OsStr` is to [`OsString`] as [`&str`] is to [`String`]: the former in each pair are borrowed /// references; the latter are owned strings. /// /// See the [module's toplevel documentation about conversions][conversions] for a discussion on From bac725ecdf31fe8ac5e7ddcd45d2c316d9aff674 Mon Sep 17 00:00:00 2001 From: muvlon Date: Thu, 11 Jan 2018 17:20:30 +0100 Subject: [PATCH 2/3] Fix dead links in docs for OsStr --- src/libstd/ffi/os_str.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 0d07c01a105e2..91e3855f536f1 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -91,6 +91,8 @@ pub struct OsString { /// the traits which `OsStr` implements for conversions from/to native representations. /// /// [`OsString`]: struct.OsString.html +/// [`&str`]: ../primitive.str.html +/// [`String`]: ../string/struct.String.html /// [conversions]: index.html#conversions #[stable(feature = "rust1", since = "1.0.0")] pub struct OsStr { From 80028760ed111b800decee876af59741f8765cce Mon Sep 17 00:00:00 2001 From: muvlon Date: Thu, 11 Jan 2018 22:01:32 +0100 Subject: [PATCH 3/3] s/OsStr/&OsStr in docs to align with &str/String comparison --- src/libstd/ffi/os_str.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 91e3855f536f1..3959e8533be5f 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -36,7 +36,7 @@ use sys_common::{AsInner, IntoInner, FromInner}; /// and platform-native string values, and in particular allowing a Rust string /// to be converted into an "OS" string with no cost if possible. /// -/// `OsString` is to [`OsStr`] as [`String`] is to [`&str`]: the former +/// `OsString` is to [`&OsStr`] as [`String`] is to [`&str`]: the former /// in each pair are owned strings; the latter are borrowed /// references. /// @@ -64,6 +64,7 @@ use sys_common::{AsInner, IntoInner, FromInner}; /// the traits which `OsString` implements for conversions from/to native representations. /// /// [`OsStr`]: struct.OsStr.html +/// [`&OsStr`]: struct.OsStr.html /// [`From`]: ../convert/trait.From.html /// [`String`]: ../string/struct.String.html /// [`&str`]: ../primitive.str.html @@ -84,7 +85,7 @@ pub struct OsString { /// This type represents a borrowed reference to a string in the operating system's preferred /// representation. /// -/// `OsStr` is to [`OsString`] as [`&str`] is to [`String`]: the former in each pair are borrowed +/// `&OsStr` is to [`OsString`] as [`&str`] is to [`String`]: the former in each pair are borrowed /// references; the latter are owned strings. /// /// See the [module's toplevel documentation about conversions][conversions] for a discussion on