Skip to content

Commit

Permalink
Rollup merge of #40226 - jdhorwitz:master, r=steveklabnik
Browse files Browse the repository at this point in the history
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
  • Loading branch information
frewsxcv authored Mar 3, 2017
2 parents 4f930fc + f7b7c1e commit 9f9c2eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ impl String {
///
/// [`str::from_utf8()`]: ../../std/str/fn.from_utf8.html
///
/// The inverse of this method is [`as_bytes`](#method.as_bytes).
///
/// # Errors
///
/// Returns `Err` if the slice is not UTF-8 with a description as to why the
Expand Down Expand Up @@ -979,6 +981,8 @@ impl String {

/// Returns a byte slice of this `String`'s contents.
///
/// The inverse of this method is [`from_utf8`](#method.from_utf8).
///
/// # Examples
///
/// Basic usage:
Expand Down

0 comments on commit 9f9c2eb

Please sign in to comment.