Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string.rs: remove "Basic usage" text #114362

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 1 addition & 72 deletions library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,6 @@ pub struct String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some invalid bytes, in a vector
/// let bytes = vec![0, 159];
Expand All @@ -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
Expand All @@ -441,8 +438,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::new();
/// ```
Expand Down Expand Up @@ -472,8 +467,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::with_capacity(10);
///
Expand Down Expand Up @@ -661,8 +654,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // 𝄞music
/// let v = &[0xD834, 0xDD1E, 0x006d, 0x0075,
Expand Down Expand Up @@ -704,8 +695,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // 𝄞mus<invalid>ic<invalid>
/// let v = &[0xD834, 0xDD1E, 0x006d, 0x0075,
Expand Down Expand Up @@ -784,8 +773,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use std::mem;
///
Expand Down Expand Up @@ -827,8 +814,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some bytes, in a vector
/// let sparkle_heart = vec![240, 159, 146, 150];
Expand All @@ -852,8 +837,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::from("hello");
/// let bytes = s.into_bytes();
Expand All @@ -871,8 +854,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::from("foo");
///
Expand All @@ -889,8 +870,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("foobar");
/// let s_mut_str = s.as_mut_str();
Expand All @@ -910,8 +889,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("foo");
///
Expand Down Expand Up @@ -966,8 +943,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::with_capacity(10);
///
Expand Down Expand Up @@ -1157,8 +1132,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("foo");
///
Expand Down Expand Up @@ -1206,8 +1179,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("abc");
///
Expand Down Expand Up @@ -1235,8 +1206,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::from("hello");
///
Expand All @@ -1263,8 +1232,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("hello");
///
Expand All @@ -1287,8 +1254,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("abč");
///
Expand Down Expand Up @@ -1321,8 +1286,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("abç");
///
Expand Down Expand Up @@ -1514,8 +1477,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::with_capacity(3);
///
Expand Down Expand Up @@ -1563,8 +1524,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("bar");
///
Expand Down Expand Up @@ -1595,8 +1554,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("hello");
///
Expand All @@ -1620,8 +1577,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let a = String::from("foo");
/// assert_eq!(a.len(), 3);
Expand All @@ -1641,8 +1596,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut v = String::new();
/// assert!(v.is_empty());
Expand Down Expand Up @@ -1697,8 +1650,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let mut s = String::from("foo");
///
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -1834,8 +1781,6 @@ impl String {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = String::from("hello");
///
Expand Down Expand Up @@ -1866,8 +1811,6 @@ impl String {
///
/// # Examples
///
/// Simple usage:
///
/// ```
/// let x = String::from("bucket");
/// let static_ref: &'static mut str = x.leak();
Expand All @@ -1886,8 +1829,6 @@ impl FromUtf8Error {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some invalid bytes, in a vector
/// let bytes = vec![0, 159];
Expand All @@ -1910,8 +1851,6 @@ impl FromUtf8Error {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some invalid bytes, in a vector
/// let bytes = vec![0, 159];
Expand All @@ -1938,8 +1877,6 @@ impl FromUtf8Error {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// // some invalid bytes, in a vector
/// let bytes = vec![0, 159];
Expand Down Expand Up @@ -2490,8 +2427,6 @@ pub trait ToString {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let i = 5;
/// let five = String::from("5");
Expand Down Expand Up @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -2866,8 +2797,6 @@ impl From<String> for Vec<u8> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s1 = String::from("hello world");
/// let v1 = Vec::from(s1);
Expand Down
Loading