str docs: remove "Basic usage" text where not useful

Not "useful" in that there is only one example given
This commit is contained in:
Tshepang Mbambo 2023-06-26 22:11:13 +02:00 committed by GitHub
parent 6f8c27ae89
commit 6bab85a456
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,8 +144,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let len = "foo".len();
/// assert_eq!(3, len);
@ -165,8 +163,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = "";
/// assert!(s.is_empty());
@ -311,8 +307,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let bytes = "bors".as_bytes();
/// assert_eq!(b"bors", bytes);
@ -387,8 +381,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = "Hello";
/// let ptr = s.as_ptr();
@ -570,8 +562,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = "Löwe 老虎 Léopard";
///
@ -649,8 +639,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = "Per Martin-Löf";
///
@ -691,8 +679,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = "Per Martin-Löf".to_string();
/// {
@ -840,8 +826,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut bytes = "bors".bytes();
///
@ -1020,8 +1004,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let text = "Zażółć gęślą jaźń";
///
@ -1050,8 +1032,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let bananas = "bananas";
///
@ -1077,8 +1057,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let bananas = "bananas";
///
@ -1103,8 +1081,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let bananas = "bananas";
///
@ -1463,8 +1439,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let v: Vec<&str> = "A.B.".split_terminator('.').collect();
/// assert_eq!(v, ["A", "B"]);
@ -1696,8 +1670,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
/// assert_eq!(v, ["abc", "abc", "abc"]);
@ -1732,8 +1704,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
/// assert_eq!(v, ["abc", "abc", "abc"]);
@ -1775,8 +1745,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
/// assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
@ -1817,8 +1785,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
/// assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
@ -1845,8 +1811,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = "\n Hello\tworld\t\n";
///
@ -2085,8 +2049,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
/// assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
@ -2232,8 +2194,6 @@ impl str {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
/// assert_eq!("123foo1bar123".trim_left_matches(char::is_numeric), "foo1bar123");