Simplify wording

Co-authored-by: Josh Triplett <josh@joshtriplett.org>
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
This commit is contained in:
Tim McNamara 2021-10-09 20:51:36 +13:00 committed by GitHub
parent 6a52fb7303
commit fa5a212896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1334,9 +1334,9 @@ impl<T: Copy> From<Cow<'_, [T]>> for Box<[T]> {
/// Converts a `Cow<'_, [T]>` into a `Box<[T]>` /// Converts a `Cow<'_, [T]>` into a `Box<[T]>`
/// ///
/// When `cow` is the `Cow::Borrowed` variant, this /// When `cow` is the `Cow::Borrowed` variant, this
/// conversion allocates on the heap and performs a copy of the /// conversion allocates on the heap and copies the
/// underlying slice. Otherwise, it will try to re-use the owned /// underlying slice. Otherwise, it will try to reuse the owned
/// vec's allocation. /// `Vec`'s allocation.
#[inline] #[inline]
fn from(cow: Cow<'_, [T]>) -> Box<[T]> { fn from(cow: Cow<'_, [T]>) -> Box<[T]> {
match cow { match cow {
@ -1372,7 +1372,7 @@ impl From<Cow<'_, str>> for Box<str> {
/// Converts a `Cow<'_, str>` into a `Box<str>` /// Converts a `Cow<'_, str>` into a `Box<str>`
/// ///
/// When `cow` is the `Cow::Borrowed` variant, this /// When `cow` is the `Cow::Borrowed` variant, this
/// conversion allocates on the heap and performs a copy of the /// conversion allocates on the heap and copies the
/// underlying `str`. Otherwise, it will try to re-use the owned /// underlying `str`. Otherwise, it will try to re-use the owned
/// `String`'s allocation. /// `String`'s allocation.
/// ///