@@ -325,8 +325,10 @@ impl str {
325
325
326
326
/// Returns a subslice of `str`.
327
327
///
328
- /// This is the non-panicking alternative to indexing the `str`. Returns `None` whenever
329
- /// equivalent indexing operation would panic.
328
+ /// This is the non-panicking alternative to indexing the `str`. Returns
329
+ /// [`None`] whenever equivalent indexing operation would panic.
330
+ ///
331
+ /// [`None`]: option/enum.Option.html#variant.None
330
332
///
331
333
/// # Examples
332
334
///
@@ -346,8 +348,10 @@ impl str {
346
348
347
349
/// Returns a mutable subslice of `str`.
348
350
///
349
- /// This is the non-panicking alternative to indexing the `str`. Returns `None` whenever
350
- /// equivalent indexing operation would panic.
351
+ /// This is the non-panicking alternative to indexing the `str`. Returns
352
+ /// [`None`] whenever equivalent indexing operation would panic.
353
+ ///
354
+ /// [`None`]: option/enum.Option.html#variant.None
351
355
///
352
356
/// # Examples
353
357
///
@@ -570,7 +574,7 @@ impl str {
570
574
core_str:: StrExt :: split_at_mut ( self , mid)
571
575
}
572
576
573
- /// Returns an iterator over the `char`s of a string slice.
577
+ /// Returns an iterator over the [ `char`] s of a string slice.
574
578
///
575
579
/// As a string slice consists of valid UTF-8, we can iterate through a
576
580
/// string slice by [`char`]. This method returns such an iterator.
@@ -1657,13 +1661,13 @@ impl str {
1657
1661
1658
1662
/// Parses this string slice into another type.
1659
1663
///
1660
- /// Because `parse() ` is so general, it can cause problems with type
1661
- /// inference. As such, `parse() ` is one of the few times you'll see
1664
+ /// Because `parse` is so general, it can cause problems with type
1665
+ /// inference. As such, `parse` is one of the few times you'll see
1662
1666
/// the syntax affectionately known as the 'turbofish': `::<>`. This
1663
1667
/// helps the inference algorithm understand specifically which type
1664
1668
/// you're trying to parse into.
1665
1669
///
1666
- /// `parse() ` can parse any type that implements the [`FromStr`] trait.
1670
+ /// `parse` can parse any type that implements the [`FromStr`] trait.
1667
1671
///
1668
1672
/// [`FromStr`]: str/trait.FromStr.html
1669
1673
///
@@ -1746,7 +1750,7 @@ impl str {
1746
1750
///
1747
1751
/// `replacen` creates a new [`String`], and copies the data from this string slice into it.
1748
1752
/// While doing so, it attempts to find matches of a pattern. If it finds any, it
1749
- /// replaces them with the replacement string slice at most `N ` times.
1753
+ /// replaces them with the replacement string slice at most `count ` times.
1750
1754
///
1751
1755
/// [`String`]: string/struct.String.html
1752
1756
///
@@ -1892,33 +1896,40 @@ impl str {
1892
1896
return s;
1893
1897
}
1894
1898
1895
- /// Escapes each char in `s` with `char::escape_debug`.
1899
+ /// Escapes each char in `s` with [`char::escape_debug`].
1900
+ ///
1901
+ /// [`char::escape_debug`]: primitive.char.html#method.escape_debug
1896
1902
#[ unstable( feature = "str_escape" ,
1897
1903
reason = "return type may change to be an iterator" ,
1898
1904
issue = "27791" ) ]
1899
1905
pub fn escape_debug ( & self ) -> String {
1900
1906
self . chars ( ) . flat_map ( |c| c. escape_debug ( ) ) . collect ( )
1901
1907
}
1902
1908
1903
- /// Escapes each char in `s` with `char::escape_default`.
1909
+ /// Escapes each char in `s` with [`char::escape_default`].
1910
+ ///
1911
+ /// [`char::escape_default`]: primitive.char.html#method.escape_default
1904
1912
#[ unstable( feature = "str_escape" ,
1905
1913
reason = "return type may change to be an iterator" ,
1906
1914
issue = "27791" ) ]
1907
1915
pub fn escape_default ( & self ) -> String {
1908
1916
self . chars ( ) . flat_map ( |c| c. escape_default ( ) ) . collect ( )
1909
1917
}
1910
1918
1911
- /// Escapes each char in `s` with `char::escape_unicode`.
1919
+ /// Escapes each char in `s` with [`char::escape_unicode`].
1920
+ ///
1921
+ /// [`char::escape_unicode`]: primitive.char.html#method.escape_unicode
1912
1922
#[ unstable( feature = "str_escape" ,
1913
1923
reason = "return type may change to be an iterator" ,
1914
1924
issue = "27791" ) ]
1915
1925
pub fn escape_unicode ( & self ) -> String {
1916
1926
self . chars ( ) . flat_map ( |c| c. escape_unicode ( ) ) . collect ( )
1917
1927
}
1918
1928
1919
- /// Converts a `Box<str>` into a [`String`] without copying or allocating.
1929
+ /// Converts a [ `Box<str>`] into a [`String`] without copying or allocating.
1920
1930
///
1921
1931
/// [`String`]: string/struct.String.html
1932
+ /// [`Box<str>`]: boxed/struct.Box.html
1922
1933
///
1923
1934
/// # Examples
1924
1935
///
0 commit comments