|
1 |
| -//! A UTF-8 encoded, growable string. |
| 1 | +//! A UTF-8–encoded, growable string. |
2 | 2 | //!
|
3 |
| -//! This module contains the [`String`] type, a trait for converting |
4 |
| -//! [`ToString`]s, and several error types that may result from working with |
5 |
| -//! [`String`]s. |
| 3 | +//! This module contains the [`String`] type, the [`ToString`] trait for |
| 4 | +//! converting to strings, and several error types that may result from |
| 5 | +//! working with [`String`]s. |
6 | 6 | //!
|
7 | 7 | //! # Examples
|
8 | 8 | //!
|
@@ -57,7 +57,7 @@ use crate::collections::TryReserveError;
|
57 | 57 | use crate::str::{self, from_boxed_utf8_unchecked, Chars, FromStr, Utf8Error};
|
58 | 58 | use crate::vec::Vec;
|
59 | 59 |
|
60 |
| -/// A UTF-8 encoded, growable string. |
| 60 | +/// A UTF-8–encoded, growable string. |
61 | 61 | ///
|
62 | 62 | /// The `String` type is the most common string type that has ownership over the
|
63 | 63 | /// contents of the string. It has a close relationship with its borrowed
|
@@ -565,7 +565,7 @@ impl String {
|
565 | 565 | Cow::Owned(res)
|
566 | 566 | }
|
567 | 567 |
|
568 |
| - /// Decode a UTF-16 encoded vector `v` into a `String`, returning [`Err`] |
| 568 | + /// Decode a UTF-16–encoded vector `v` into a `String`, returning [`Err`] |
569 | 569 | /// if `v` contains any invalid data.
|
570 | 570 | ///
|
571 | 571 | /// # Examples
|
@@ -599,7 +599,7 @@ impl String {
|
599 | 599 | Ok(ret)
|
600 | 600 | }
|
601 | 601 |
|
602 |
| - /// Decode a UTF-16 encoded slice `v` into a `String`, replacing |
| 602 | + /// Decode a UTF-16–encoded slice `v` into a `String`, replacing |
603 | 603 | /// invalid data with [the replacement character (`U+FFFD`)][U+FFFD].
|
604 | 604 | ///
|
605 | 605 | /// Unlike [`from_utf8_lossy`] which returns a [`Cow<'a, str>`],
|
@@ -2191,8 +2191,9 @@ pub trait ToString {
|
2191 | 2191 | #[stable(feature = "rust1", since = "1.0.0")]
|
2192 | 2192 | impl<T: fmt::Display + ?Sized> ToString for T {
|
2193 | 2193 | // A common guideline is to not inline generic functions. However,
|
2194 |
| - // remove `#[inline]` from this method causes non-negligible regression. |
2195 |
| - // See <https://github.com/rust-lang/rust/pull/74852> as last attempt try to remove it. |
| 2194 | + // removing `#[inline]` from this method causes non-negligible regressions. |
| 2195 | + // See <https://github.com/rust-lang/rust/pull/74852>, the last attempt |
| 2196 | + // to try to remove it. |
2196 | 2197 | #[inline]
|
2197 | 2198 | default fn to_string(&self) -> String {
|
2198 | 2199 | use fmt::Write;
|
|
0 commit comments