Skip to content

Commit dfb0d09

Browse files
authored
Rollup merge of #78163 - camelid:fixup-lib-docs, r=m-ou-se
Clean up lib docs Cherry-picked out of #78094.
2 parents 025481a + 13bc087 commit dfb0d09

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Diff for: library/alloc/src/string.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//! A UTF-8 encoded, growable string.
1+
//! A UTF-8encoded, growable string.
22
//!
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.
66
//!
77
//! # Examples
88
//!
@@ -57,7 +57,7 @@ use crate::collections::TryReserveError;
5757
use crate::str::{self, from_boxed_utf8_unchecked, Chars, FromStr, Utf8Error};
5858
use crate::vec::Vec;
5959

60-
/// A UTF-8 encoded, growable string.
60+
/// A UTF-8encoded, growable string.
6161
///
6262
/// The `String` type is the most common string type that has ownership over the
6363
/// contents of the string. It has a close relationship with its borrowed
@@ -565,7 +565,7 @@ impl String {
565565
Cow::Owned(res)
566566
}
567567

568-
/// Decode a UTF-16 encoded vector `v` into a `String`, returning [`Err`]
568+
/// Decode a UTF-16encoded vector `v` into a `String`, returning [`Err`]
569569
/// if `v` contains any invalid data.
570570
///
571571
/// # Examples
@@ -599,7 +599,7 @@ impl String {
599599
Ok(ret)
600600
}
601601

602-
/// Decode a UTF-16 encoded slice `v` into a `String`, replacing
602+
/// Decode a UTF-16encoded slice `v` into a `String`, replacing
603603
/// invalid data with [the replacement character (`U+FFFD`)][U+FFFD].
604604
///
605605
/// Unlike [`from_utf8_lossy`] which returns a [`Cow<'a, str>`],
@@ -2191,8 +2191,9 @@ pub trait ToString {
21912191
#[stable(feature = "rust1", since = "1.0.0")]
21922192
impl<T: fmt::Display + ?Sized> ToString for T {
21932193
// 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.
21962197
#[inline]
21972198
default fn to_string(&self) -> String {
21982199
use fmt::Write;

0 commit comments

Comments
 (0)