Skip to content

Commit 4e8f135

Browse files
authored
Rollup merge of #113072 - tshepang:patch-1, r=cuviper
str docs: remove "Basic usage" text where not useful Not "useful" in that there is only one example given
2 parents f4b80ca + 6bab85a commit 4e8f135

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

library/core/src/str/mod.rs

-40
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ impl str {
144144
///
145145
/// # Examples
146146
///
147-
/// Basic usage:
148-
///
149147
/// ```
150148
/// let len = "foo".len();
151149
/// assert_eq!(3, len);
@@ -165,8 +163,6 @@ impl str {
165163
///
166164
/// # Examples
167165
///
168-
/// Basic usage:
169-
///
170166
/// ```
171167
/// let s = "";
172168
/// assert!(s.is_empty());
@@ -311,8 +307,6 @@ impl str {
311307
///
312308
/// # Examples
313309
///
314-
/// Basic usage:
315-
///
316310
/// ```
317311
/// let bytes = "bors".as_bytes();
318312
/// assert_eq!(b"bors", bytes);
@@ -387,8 +381,6 @@ impl str {
387381
///
388382
/// # Examples
389383
///
390-
/// Basic usage:
391-
///
392384
/// ```
393385
/// let s = "Hello";
394386
/// let ptr = s.as_ptr();
@@ -570,8 +562,6 @@ impl str {
570562
///
571563
/// # Examples
572564
///
573-
/// Basic usage:
574-
///
575565
/// ```
576566
/// let s = "Löwe 老虎 Léopard";
577567
///
@@ -649,8 +639,6 @@ impl str {
649639
///
650640
/// # Examples
651641
///
652-
/// Basic usage:
653-
///
654642
/// ```
655643
/// let s = "Per Martin-Löf";
656644
///
@@ -691,8 +679,6 @@ impl str {
691679
///
692680
/// # Examples
693681
///
694-
/// Basic usage:
695-
///
696682
/// ```
697683
/// let mut s = "Per Martin-Löf".to_string();
698684
/// {
@@ -840,8 +826,6 @@ impl str {
840826
///
841827
/// # Examples
842828
///
843-
/// Basic usage:
844-
///
845829
/// ```
846830
/// let mut bytes = "bors".bytes();
847831
///
@@ -1020,8 +1004,6 @@ impl str {
10201004
///
10211005
/// # Examples
10221006
///
1023-
/// Basic usage:
1024-
///
10251007
/// ```
10261008
/// let text = "Zażółć gęślą jaźń";
10271009
///
@@ -1050,8 +1032,6 @@ impl str {
10501032
///
10511033
/// # Examples
10521034
///
1053-
/// Basic usage:
1054-
///
10551035
/// ```
10561036
/// let bananas = "bananas";
10571037
///
@@ -1077,8 +1057,6 @@ impl str {
10771057
///
10781058
/// # Examples
10791059
///
1080-
/// Basic usage:
1081-
///
10821060
/// ```
10831061
/// let bananas = "bananas";
10841062
///
@@ -1103,8 +1081,6 @@ impl str {
11031081
///
11041082
/// # Examples
11051083
///
1106-
/// Basic usage:
1107-
///
11081084
/// ```
11091085
/// let bananas = "bananas";
11101086
///
@@ -1463,8 +1439,6 @@ impl str {
14631439
///
14641440
/// # Examples
14651441
///
1466-
/// Basic usage:
1467-
///
14681442
/// ```
14691443
/// let v: Vec<&str> = "A.B.".split_terminator('.').collect();
14701444
/// assert_eq!(v, ["A", "B"]);
@@ -1696,8 +1670,6 @@ impl str {
16961670
///
16971671
/// # Examples
16981672
///
1699-
/// Basic usage:
1700-
///
17011673
/// ```
17021674
/// let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
17031675
/// assert_eq!(v, ["abc", "abc", "abc"]);
@@ -1732,8 +1704,6 @@ impl str {
17321704
///
17331705
/// # Examples
17341706
///
1735-
/// Basic usage:
1736-
///
17371707
/// ```
17381708
/// let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
17391709
/// assert_eq!(v, ["abc", "abc", "abc"]);
@@ -1775,8 +1745,6 @@ impl str {
17751745
///
17761746
/// # Examples
17771747
///
1778-
/// Basic usage:
1779-
///
17801748
/// ```
17811749
/// let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
17821750
/// assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
@@ -1817,8 +1785,6 @@ impl str {
18171785
///
18181786
/// # Examples
18191787
///
1820-
/// Basic usage:
1821-
///
18221788
/// ```
18231789
/// let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
18241790
/// assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
@@ -1845,8 +1811,6 @@ impl str {
18451811
///
18461812
/// # Examples
18471813
///
1848-
/// Basic usage:
1849-
///
18501814
/// ```
18511815
/// let s = "\n Hello\tworld\t\n";
18521816
///
@@ -2085,8 +2049,6 @@ impl str {
20852049
///
20862050
/// # Examples
20872051
///
2088-
/// Basic usage:
2089-
///
20902052
/// ```
20912053
/// assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
20922054
/// assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
@@ -2232,8 +2194,6 @@ impl str {
22322194
///
22332195
/// # Examples
22342196
///
2235-
/// Basic usage:
2236-
///
22372197
/// ```
22382198
/// assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
22392199
/// assert_eq!("123foo1bar123".trim_left_matches(char::is_numeric), "foo1bar123");

0 commit comments

Comments
 (0)