Skip to content

Commit 68a5a16

Browse files
author
Ariel Ben-Yehuda
authored
Rollup merge of rust-lang#40226 - jdhorwitz:master, r=frewsxcv
Issue rust-lang#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 7c18194 + 86bad49 commit 68a5a16

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libcollections/string.rs

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

980984
/// Returns a byte slice of this `String`'s contents.
981985
///
986+
/// The inverse of this method is [`from_utf8`].
987+
///
988+
/// [`from_utf8`]: #method.from_utf8
989+
///
982990
/// # Examples
983991
///
984992
/// Basic usage:

0 commit comments

Comments
 (0)