From 47d0d2ff63f11f651e704b2d4d0471a6b2af4b7d Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 22 Jul 2020 15:17:50 +0000 Subject: [PATCH 1/2] Make str point to primitive page --- src/liballoc/string.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 15f10df9a45cc..a7123e0dd7d5d 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -268,7 +268,8 @@ use crate::vec::Vec; /// /// Here, there's no need to allocate more memory inside the loop. /// -/// [`&str`]: str +/// [`str`]: ../../std/primitive.str.html +/// [`&str`]: ../../std/primitive.str.html /// [`Deref`]: core::ops::Deref /// [`as_str()`]: String::as_str #[derive(PartialOrd, Eq, Ord)] From d19b12df4157dc0a4220e7b1da023ddeeb6dd503 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Thu, 23 Jul 2020 02:42:37 +0000 Subject: [PATCH 2/2] Prefer type@str --- src/liballoc/string.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index a7123e0dd7d5d..f41c8c5a55910 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -65,7 +65,7 @@ use crate::vec::Vec; /// /// # Examples /// -/// You can create a `String` from [a literal string][str] with [`String::from`]: +/// You can create a `String` from [a literal string][`str`] with [`String::from`]: /// /// [`String::from`]: From::from /// @@ -268,8 +268,8 @@ use crate::vec::Vec; /// /// Here, there's no need to allocate more memory inside the loop. /// -/// [`str`]: ../../std/primitive.str.html -/// [`&str`]: ../../std/primitive.str.html +/// [`str`]: type@str +/// [`&str`]: type@str /// [`Deref`]: core::ops::Deref /// [`as_str()`]: String::as_str #[derive(PartialOrd, Eq, Ord)]