Skip to content

Commit 477bdcd

Browse files
authored
Rollup merge of #64737 - jordins:master, r=steveklabnik
fix several issues in String docs - In some places &str was shown instead of String. - into_bytes is the reverse of from_utf8 Fixes #63797 I've retaken the work done in this PR: #63865 which for some reason was closed. and just done a minor change (I hope you don't mind @sam09 ).
2 parents 1252e70 + 62dc794 commit 477bdcd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/liballoc/string.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl String {
429429

430430
/// Converts a vector of bytes to a `String`.
431431
///
432-
/// A string slice ([`&str`]) is made of bytes ([`u8`]), and a vector of bytes
432+
/// A string ([`String`]) is made of bytes ([`u8`]), and a vector of bytes
433433
/// ([`Vec<u8>`]) is made of bytes, so this function converts between the
434434
/// two. Not all byte slices are valid `String`s, however: `String`
435435
/// requires that it is valid UTF-8. `from_utf8()` checks to ensure that
@@ -446,7 +446,7 @@ impl String {
446446
/// If you need a [`&str`] instead of a `String`, consider
447447
/// [`str::from_utf8`].
448448
///
449-
/// The inverse of this method is [`as_bytes`].
449+
/// The inverse of this method is [`into_bytes`].
450450
///
451451
/// # Errors
452452
///
@@ -480,11 +480,11 @@ impl String {
480480
/// with this error.
481481
///
482482
/// [`from_utf8_unchecked`]: struct.String.html#method.from_utf8_unchecked
483-
/// [`&str`]: ../../std/primitive.str.html
483+
/// [`String`]: struct.String.html
484484
/// [`u8`]: ../../std/primitive.u8.html
485485
/// [`Vec<u8>`]: ../../std/vec/struct.Vec.html
486486
/// [`str::from_utf8`]: ../../std/str/fn.from_utf8.html
487-
/// [`as_bytes`]: struct.String.html#method.as_bytes
487+
/// [`into_bytes`]: struct.String.html#method.into_bytes
488488
/// [`FromUtf8Error`]: struct.FromUtf8Error.html
489489
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
490490
#[inline]

0 commit comments

Comments
 (0)