Rollup merge of #114362 - tshepang:patch-1, r=Mark-Simulacrum

string.rs: remove "Basic usage" text

Only a single example is given
This commit is contained in:
Matthias Krüger 2023-08-07 05:29:11 +02:00 committed by GitHub
commit 59d2a4b1e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -388,8 +388,6 @@ pub struct String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some invalid bytes, in a vector
/// let bytes = vec![0, 159];
@ -412,9 +410,8 @@ pub struct FromUtf8Error {
/// This type is the error type for the [`from_utf16`] method on [`String`].
///
/// [`from_utf16`]: String::from_utf16
/// # Examples
///
/// Basic usage:
/// # Examples
///
/// ```
/// // 𝄞mu<invalid>ic
@ -441,8 +438,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::new();
/// ```
@ -472,8 +467,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::with_capacity(10);
///
@ -661,8 +654,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // 𝄞music
/// let v = &[0xD834, 0xDD1E, 0x006d, 0x0075,
@ -704,8 +695,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // 𝄞mus<invalid>ic<invalid>
/// let v = &[0xD834, 0xDD1E, 0x006d, 0x0075,
@ -784,8 +773,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use std::mem;
///
@ -827,8 +814,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some bytes, in a vector
/// let sparkle_heart = vec![240, 159, 146, 150];
@ -852,8 +837,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::from("hello");
/// let bytes = s.into_bytes();
@ -871,8 +854,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::from("foo");
///
@ -889,8 +870,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("foobar");
/// let s_mut_str = s.as_mut_str();
@ -910,8 +889,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("foo");
///
@ -966,8 +943,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::with_capacity(10);
///
@ -1157,8 +1132,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("foo");
///
@ -1206,8 +1179,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("abc");
///
@ -1235,8 +1206,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::from("hello");
///
@ -1263,8 +1232,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("hello");
///
@ -1287,8 +1254,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("abč");
///
@ -1321,8 +1286,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("abç");
///
@ -1514,8 +1477,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::with_capacity(3);
///
@ -1563,8 +1524,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("bar");
///
@ -1595,8 +1554,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("hello");
///
@ -1620,8 +1577,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let a = String::from("foo");
/// assert_eq!(a.len(), 3);
@ -1641,8 +1596,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut v = String::new();
/// assert!(v.is_empty());
@ -1697,8 +1650,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("foo");
///
@ -1734,8 +1685,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("α is alpha, β is beta");
/// let beta_offset = s.find('β').unwrap_or(s.len());
@ -1784,8 +1733,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("α is alpha, β is beta");
/// let beta_offset = s.find('β').unwrap_or(s.len());
@ -1834,8 +1781,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::from("hello");
///
@ -1866,8 +1811,6 @@ impl String {
///
/// # Examples
///
/// Simple usage:
///
/// ```
/// let x = String::from("bucket");
/// let static_ref: &'static mut str = x.leak();
@ -1886,8 +1829,6 @@ impl FromUtf8Error {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some invalid bytes, in a vector
/// let bytes = vec![0, 159];
@ -1910,8 +1851,6 @@ impl FromUtf8Error {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some invalid bytes, in a vector
/// let bytes = vec![0, 159];
@ -1938,8 +1877,6 @@ impl FromUtf8Error {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some invalid bytes, in a vector
/// let bytes = vec![0, 159];
@ -2490,8 +2427,6 @@ pub trait ToString {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let i = 5;
/// let five = String::from("5");
@ -2711,8 +2646,6 @@ impl From<Box<str>> for String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s1: String = String::from("hello world");
/// let s2: Box<str> = s1.into_boxed_str();
@ -2732,8 +2665,6 @@ impl From<String> for Box<str> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s1: String = String::from("hello world");
/// let s2: Box<str> = Box::from(s1);
@ -2866,8 +2797,6 @@ impl From<String> for Vec<u8> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s1 = String::from("hello world");
/// let v1 = Vec::from(s1);