@@ -67,8 +67,6 @@ use crate::vec::Vec;
67
67
/// contents of the string. It has a close relationship with its borrowed
68
68
/// counterpart, the primitive [`str`].
69
69
///
70
- /// [`str`]: ../../std/primitive.str.html
71
- ///
72
70
/// # Examples
73
71
///
74
72
/// You can create a `String` from a literal string with [`String::from`]:
@@ -88,7 +86,6 @@ use crate::vec::Vec;
88
86
/// ```
89
87
///
90
88
/// [`String::from`]: #method.from
91
- /// [`char`]: ../../std/primitive.char.html
92
89
/// [`push`]: #method.push
93
90
/// [`push_str`]: #method.push_str
94
91
///
@@ -128,8 +125,8 @@ use crate::vec::Vec;
128
125
/// The [`bytes`] and [`chars`] methods return iterators over the first
129
126
/// two, respectively.
130
127
///
131
- /// [`bytes`]: #method. bytes
132
- /// [`chars`]: #method. chars
128
+ /// [`bytes`]: str:: bytes
129
+ /// [`chars`]: str:: chars
133
130
///
134
131
/// # Deref
135
132
///
@@ -215,7 +212,7 @@ use crate::vec::Vec;
215
212
/// assert_eq!(String::from("Once upon a time..."), s);
216
213
/// ```
217
214
///
218
- /// [`as_ptr`]: #method. as_ptr
215
+ /// [`as_ptr`]: str:: as_ptr
219
216
/// [`len`]: #method.len
220
217
/// [`capacity`]: #method.capacity
221
218
///
@@ -274,9 +271,11 @@ use crate::vec::Vec;
274
271
///
275
272
/// Here, there's no need to allocate more memory inside the loop.
276
273
///
274
+ /// [`char`]: type@char
275
+ /// [`str`]: ../../std/primitive.str.html
277
276
/// [`&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
280
279
#[ derive( PartialOrd , Eq , Ord ) ]
281
280
#[ cfg_attr( not( test) , rustc_diagnostic_item = "string_type" ) ]
282
281
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -302,7 +301,6 @@ pub struct String {
302
301
///
303
302
/// [`Utf8Error`]: ../../std/str/struct.Utf8Error.html
304
303
/// [`std::str`]: ../../std/str/index.html
305
- /// [`u8`]: ../../std/primitive.u8.html
306
304
/// [`&str`]: ../../std/primitive.str.html
307
305
/// [`utf8_error`]: #method.utf8_error
308
306
///
@@ -481,13 +479,11 @@ impl String {
481
479
///
482
480
/// [`from_utf8_unchecked`]: struct.String.html#method.from_utf8_unchecked
483
481
/// [`String`]: struct.String.html
484
- /// [`u8`]: ../../std/primitive.u8.html
485
- /// [`Vec<u8>`]: ../../std/vec/struct.Vec.html
482
+ /// [`Vec<u8>`]: Vec
486
483
/// [`&str`]: ../../std/primitive.str.html
487
484
/// [`str::from_utf8`]: ../../std/str/fn.from_utf8.html
488
485
/// [`into_bytes`]: struct.String.html#method.into_bytes
489
486
/// [`FromUtf8Error`]: struct.FromUtf8Error.html
490
- /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
491
487
#[ inline]
492
488
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
493
489
pub fn from_utf8 ( vec : Vec < u8 > ) -> Result < String , FromUtf8Error > {
@@ -506,9 +502,8 @@ impl String {
506
502
/// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with
507
503
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD], which looks like this: �
508
504
///
509
- /// [`u8`]: ../../std/primitive.u8.html
510
505
/// [byteslice]: ../../std/primitive.slice.html
511
- /// [U+FFFD]: ../ char/constant. REPLACEMENT_CHARACTER.html
506
+ /// [U+FFFD]: core:: char:: REPLACEMENT_CHARACTER
512
507
///
513
508
/// If you are sure that the byte slice is valid UTF-8, and you don't want
514
509
/// to incur the overhead of the conversion, there is an unsafe version
@@ -523,7 +518,7 @@ impl String {
523
518
/// it's already valid UTF-8, we don't need a new allocation. This return
524
519
/// type allows us to handle both cases.
525
520
///
526
- /// [`Cow<'a, str>`]: ../../std/ borrow/enum. Cow.html
521
+ /// [`Cow<'a, str>`]: crate:: borrow:: Cow
527
522
///
528
523
/// # Examples
529
524
///
@@ -583,8 +578,6 @@ impl String {
583
578
/// Decode a UTF-16 encoded vector `v` into a `String`, returning [`Err`]
584
579
/// if `v` contains any invalid data.
585
580
///
586
- /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
587
- ///
588
581
/// # Examples
589
582
///
590
583
/// Basic usage:
@@ -624,8 +617,8 @@ impl String {
624
617
/// conversion requires a memory allocation.
625
618
///
626
619
/// [`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
629
622
///
630
623
/// # Examples
631
624
///
@@ -1076,8 +1069,6 @@ impl String {
1076
1069
1077
1070
/// Appends the given [`char`] to the end of this `String`.
1078
1071
///
1079
- /// [`char`]: ../../std/primitive.char.html
1080
- ///
1081
1072
/// # Examples
1082
1073
///
1083
1074
/// Basic usage:
@@ -1133,8 +1124,6 @@ impl String {
1133
1124
///
1134
1125
/// Panics if `new_len` does not lie on a [`char`] boundary.
1135
1126
///
1136
- /// [`char`]: ../../std/primitive.char.html
1137
- ///
1138
1127
/// # Examples
1139
1128
///
1140
1129
/// Basic usage:
@@ -1159,8 +1148,6 @@ impl String {
1159
1148
///
1160
1149
/// Returns [`None`] if this `String` is empty.
1161
1150
///
1162
- /// [`None`]: ../../std/option/enum.Option.html#variant.None
1163
- ///
1164
1151
/// # Examples
1165
1152
///
1166
1153
/// Basic usage:
@@ -1195,8 +1182,6 @@ impl String {
1195
1182
/// Panics if `idx` is larger than or equal to the `String`'s length,
1196
1183
/// or if it does not lie on a [`char`] boundary.
1197
1184
///
1198
- /// [`char`]: ../../std/primitive.char.html
1199
- ///
1200
1185
/// # Examples
1201
1186
///
1202
1187
/// Basic usage:
@@ -1297,8 +1282,6 @@ impl String {
1297
1282
/// Panics if `idx` is larger than the `String`'s length, or if it does not
1298
1283
/// lie on a [`char`] boundary.
1299
1284
///
1300
- /// [`char`]: ../../std/primitive.char.html
1301
- ///
1302
1285
/// # Examples
1303
1286
///
1304
1287
/// Basic usage:
@@ -1346,8 +1329,6 @@ impl String {
1346
1329
/// Panics if `idx` is larger than the `String`'s length, or if it does not
1347
1330
/// lie on a [`char`] boundary.
1348
1331
///
1349
- /// [`char`]: ../../std/primitive.char.html
1350
- ///
1351
1332
/// # Examples
1352
1333
///
1353
1334
/// Basic usage:
@@ -1507,8 +1488,6 @@ impl String {
1507
1488
/// Panics if the starting point or end point do not lie on a [`char`]
1508
1489
/// boundary, or if they're out of bounds.
1509
1490
///
1510
- /// [`char`]: ../../std/primitive.char.html
1511
- ///
1512
1491
/// # Examples
1513
1492
///
1514
1493
/// Basic usage:
@@ -1567,9 +1546,6 @@ impl String {
1567
1546
/// Panics if the starting point or end point do not lie on a [`char`]
1568
1547
/// boundary, or if they're out of bounds.
1569
1548
///
1570
- /// [`char`]: ../../std/primitive.char.html
1571
- /// [`Vec::splice`]: ../../std/vec/struct.Vec.html#method.splice
1572
- ///
1573
1549
/// # Examples
1574
1550
///
1575
1551
/// Basic usage:
@@ -1610,7 +1586,7 @@ impl String {
1610
1586
///
1611
1587
/// This will drop any excess capacity.
1612
1588
///
1613
- /// [`Box`]: ../../std/ boxed/struct. Box.html
1589
+ /// [`Box`]: crate:: boxed:: Box
1614
1590
/// [`str`]: ../../std/primitive.str.html
1615
1591
///
1616
1592
/// # Examples
@@ -1682,7 +1658,6 @@ impl FromUtf8Error {
1682
1658
///
1683
1659
/// [`Utf8Error`]: ../../std/str/struct.Utf8Error.html
1684
1660
/// [`std::str`]: ../../std/str/index.html
1685
- /// [`u8`]: ../../std/primitive.u8.html
1686
1661
/// [`&str`]: ../../std/primitive.str.html
1687
1662
///
1688
1663
/// # Examples
@@ -2187,7 +2162,7 @@ impl ops::DerefMut for String {
2187
2162
///
2188
2163
/// This alias exists for backwards compatibility, and may be eventually deprecated.
2189
2164
///
2190
- /// [`Infallible`]: ../../ core/ convert/enum. Infallible.html
2165
+ /// [`Infallible`]: core:: convert:: Infallible
2191
2166
#[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
2192
2167
pub type ParseError = core:: convert:: Infallible ;
2193
2168
@@ -2207,7 +2182,7 @@ impl FromStr for String {
2207
2182
/// [`Display`] should be implemented instead, and you get the `ToString`
2208
2183
/// implementation for free.
2209
2184
///
2210
- /// [`Display`]: ../../std/ fmt/trait. Display.html
2185
+ /// [`Display`]: crate:: fmt:: Display
2211
2186
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2212
2187
pub trait ToString {
2213
2188
/// Converts the given value to a `String`.
0 commit comments