Skip to content

Commit 9f9c2eb

Browse files
authored
Rollup merge of #40226 - jdhorwitz:master, r=steveklabnik
Issue #39688 - Help people find String::as_bytes() for UTF-8 Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa. ?r @steveklabnik
2 parents 4f930fc + f7b7c1e commit 9f9c2eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libcollections/string.rs

+4
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ impl String {
433433
///
434434
/// [`str::from_utf8()`]: ../../std/str/fn.from_utf8.html
435435
///
436+
/// The inverse of this method is [`as_bytes`](#method.as_bytes).
437+
///
436438
/// # Errors
437439
///
438440
/// Returns `Err` if the slice is not UTF-8 with a description as to why the
@@ -979,6 +981,8 @@ impl String {
979981

980982
/// Returns a byte slice of this `String`'s contents.
981983
///
984+
/// The inverse of this method is [`from_utf8`](#method.from_utf8).
985+
///
982986
/// # Examples
983987
///
984988
/// Basic usage:

0 commit comments

Comments
 (0)