@@ -67,8 +67,6 @@ use crate::vec::Vec;
6767/// contents of the string. It has a close relationship with its borrowed
6868/// counterpart, the primitive [`str`].
6969///
70- /// [`str`]: ../../std/primitive.str.html
71- ///
7270/// # Examples
7371///
7472/// You can create a `String` from a literal string with [`String::from`]:
@@ -88,7 +86,6 @@ use crate::vec::Vec;
8886/// ```
8987///
9088/// [`String::from`]: #method.from
91- /// [`char`]: ../../std/primitive.char.html
9289/// [`push`]: #method.push
9390/// [`push_str`]: #method.push_str
9491///
@@ -128,8 +125,8 @@ use crate::vec::Vec;
128125/// The [`bytes`] and [`chars`] methods return iterators over the first
129126/// two, respectively.
130127///
131- /// [`bytes`]: #method. bytes
132- /// [`chars`]: #method. chars
128+ /// [`bytes`]: str:: bytes
129+ /// [`chars`]: str:: chars
133130///
134131/// # Deref
135132///
@@ -215,7 +212,7 @@ use crate::vec::Vec;
215212/// assert_eq!(String::from("Once upon a time..."), s);
216213/// ```
217214///
218- /// [`as_ptr`]: #method. as_ptr
215+ /// [`as_ptr`]: str:: as_ptr
219216/// [`len`]: #method.len
220217/// [`capacity`]: #method.capacity
221218///
@@ -274,9 +271,11 @@ use crate::vec::Vec;
274271///
275272/// Here, there's no need to allocate more memory inside the loop.
276273///
274+ /// [`char`]: type@char
275+ /// [`str`]: ../../std/primitive.str.html
277276/// [`&str`]: ../../std/primitive.str.html
278- /// [`Deref`]: ../../std/ ops/trait. Deref.html
279- /// [`as_str()`]: struct.String.html #method.as_str
277+ /// [`Deref`]: core:: ops:: Deref
278+ /// [`as_str()`]: #method.as_str
280279#[ derive( PartialOrd , Eq , Ord ) ]
281280#[ cfg_attr( not( test) , rustc_diagnostic_item = "string_type" ) ]
282281#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -302,7 +301,6 @@ pub struct String {
302301///
303302/// [`Utf8Error`]: ../../std/str/struct.Utf8Error.html
304303/// [`std::str`]: ../../std/str/index.html
305- /// [`u8`]: ../../std/primitive.u8.html
306304/// [`&str`]: ../../std/primitive.str.html
307305/// [`utf8_error`]: #method.utf8_error
308306///
@@ -481,13 +479,11 @@ impl String {
481479 ///
482480 /// [`from_utf8_unchecked`]: struct.String.html#method.from_utf8_unchecked
483481 /// [`String`]: struct.String.html
484- /// [`u8`]: ../../std/primitive.u8.html
485- /// [`Vec<u8>`]: ../../std/vec/struct.Vec.html
482+ /// [`Vec<u8>`]: Vec
486483 /// [`&str`]: ../../std/primitive.str.html
487484 /// [`str::from_utf8`]: ../../std/str/fn.from_utf8.html
488485 /// [`into_bytes`]: struct.String.html#method.into_bytes
489486 /// [`FromUtf8Error`]: struct.FromUtf8Error.html
490- /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
491487 #[ inline]
492488 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
493489 pub fn from_utf8 ( vec : Vec < u8 > ) -> Result < String , FromUtf8Error > {
@@ -506,9 +502,8 @@ impl String {
506502 /// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with
507503 /// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD], which looks like this: �
508504 ///
509- /// [`u8`]: ../../std/primitive.u8.html
510505 /// [byteslice]: ../../std/primitive.slice.html
511- /// [U+FFFD]: ../ char/constant. REPLACEMENT_CHARACTER.html
506+ /// [U+FFFD]: core:: char:: REPLACEMENT_CHARACTER
512507 ///
513508 /// If you are sure that the byte slice is valid UTF-8, and you don't want
514509 /// to incur the overhead of the conversion, there is an unsafe version
@@ -523,7 +518,7 @@ impl String {
523518 /// it's already valid UTF-8, we don't need a new allocation. This return
524519 /// type allows us to handle both cases.
525520 ///
526- /// [`Cow<'a, str>`]: ../../std/ borrow/enum. Cow.html
521+ /// [`Cow<'a, str>`]: crate:: borrow:: Cow
527522 ///
528523 /// # Examples
529524 ///
@@ -583,8 +578,6 @@ impl String {
583578 /// Decode a UTF-16 encoded vector `v` into a `String`, returning [`Err`]
584579 /// if `v` contains any invalid data.
585580 ///
586- /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
587- ///
588581 /// # Examples
589582 ///
590583 /// Basic usage:
@@ -624,8 +617,8 @@ impl String {
624617 /// conversion requires a memory allocation.
625618 ///
626619 /// [`from_utf8_lossy`]: #method.from_utf8_lossy
627- /// [`Cow<'a, str>`]: ../ borrow/enum. Cow.html
628- /// [U+FFFD]: ../ char/constant. REPLACEMENT_CHARACTER.html
620+ /// [`Cow<'a, str>`]: crate:: borrow:: Cow
621+ /// [U+FFFD]: core:: char:: REPLACEMENT_CHARACTER
629622 ///
630623 /// # Examples
631624 ///
@@ -1076,8 +1069,6 @@ impl String {
10761069
10771070 /// Appends the given [`char`] to the end of this `String`.
10781071 ///
1079- /// [`char`]: ../../std/primitive.char.html
1080- ///
10811072 /// # Examples
10821073 ///
10831074 /// Basic usage:
@@ -1133,8 +1124,6 @@ impl String {
11331124 ///
11341125 /// Panics if `new_len` does not lie on a [`char`] boundary.
11351126 ///
1136- /// [`char`]: ../../std/primitive.char.html
1137- ///
11381127 /// # Examples
11391128 ///
11401129 /// Basic usage:
@@ -1159,8 +1148,6 @@ impl String {
11591148 ///
11601149 /// Returns [`None`] if this `String` is empty.
11611150 ///
1162- /// [`None`]: ../../std/option/enum.Option.html#variant.None
1163- ///
11641151 /// # Examples
11651152 ///
11661153 /// Basic usage:
@@ -1195,8 +1182,6 @@ impl String {
11951182 /// Panics if `idx` is larger than or equal to the `String`'s length,
11961183 /// or if it does not lie on a [`char`] boundary.
11971184 ///
1198- /// [`char`]: ../../std/primitive.char.html
1199- ///
12001185 /// # Examples
12011186 ///
12021187 /// Basic usage:
@@ -1297,8 +1282,6 @@ impl String {
12971282 /// Panics if `idx` is larger than the `String`'s length, or if it does not
12981283 /// lie on a [`char`] boundary.
12991284 ///
1300- /// [`char`]: ../../std/primitive.char.html
1301- ///
13021285 /// # Examples
13031286 ///
13041287 /// Basic usage:
@@ -1346,8 +1329,6 @@ impl String {
13461329 /// Panics if `idx` is larger than the `String`'s length, or if it does not
13471330 /// lie on a [`char`] boundary.
13481331 ///
1349- /// [`char`]: ../../std/primitive.char.html
1350- ///
13511332 /// # Examples
13521333 ///
13531334 /// Basic usage:
@@ -1507,8 +1488,6 @@ impl String {
15071488 /// Panics if the starting point or end point do not lie on a [`char`]
15081489 /// boundary, or if they're out of bounds.
15091490 ///
1510- /// [`char`]: ../../std/primitive.char.html
1511- ///
15121491 /// # Examples
15131492 ///
15141493 /// Basic usage:
@@ -1567,9 +1546,6 @@ impl String {
15671546 /// Panics if the starting point or end point do not lie on a [`char`]
15681547 /// boundary, or if they're out of bounds.
15691548 ///
1570- /// [`char`]: ../../std/primitive.char.html
1571- /// [`Vec::splice`]: ../../std/vec/struct.Vec.html#method.splice
1572- ///
15731549 /// # Examples
15741550 ///
15751551 /// Basic usage:
@@ -1610,7 +1586,7 @@ impl String {
16101586 ///
16111587 /// This will drop any excess capacity.
16121588 ///
1613- /// [`Box`]: ../../std/ boxed/struct. Box.html
1589+ /// [`Box`]: crate:: boxed:: Box
16141590 /// [`str`]: ../../std/primitive.str.html
16151591 ///
16161592 /// # Examples
@@ -1682,7 +1658,6 @@ impl FromUtf8Error {
16821658 ///
16831659 /// [`Utf8Error`]: ../../std/str/struct.Utf8Error.html
16841660 /// [`std::str`]: ../../std/str/index.html
1685- /// [`u8`]: ../../std/primitive.u8.html
16861661 /// [`&str`]: ../../std/primitive.str.html
16871662 ///
16881663 /// # Examples
@@ -2187,7 +2162,7 @@ impl ops::DerefMut for String {
21872162///
21882163/// This alias exists for backwards compatibility, and may be eventually deprecated.
21892164///
2190- /// [`Infallible`]: ../../ core/ convert/enum. Infallible.html
2165+ /// [`Infallible`]: core:: convert:: Infallible
21912166#[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
21922167pub type ParseError = core:: convert:: Infallible ;
21932168
@@ -2207,7 +2182,7 @@ impl FromStr for String {
22072182/// [`Display`] should be implemented instead, and you get the `ToString`
22082183/// implementation for free.
22092184///
2210- /// [`Display`]: ../../std/ fmt/trait. Display.html
2185+ /// [`Display`]: crate:: fmt:: Display
22112186#[ stable( feature = "rust1" , since = "1.0.0" ) ]
22122187pub trait ToString {
22132188 /// Converts the given value to a `String`.
0 commit comments