about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>2017-03-08 20:53:51 +0200
committerGitHub <noreply@github.com>2017-03-08 20:53:51 +0200
commit68a5a167408d8d3af67c114e34bbdee8ce7e76a3 (patch)
treeac93552de980afef09c525ff268624fef074e1aa
parent7c181944984e152c996da06e812e1717c40aa110 (diff)
parent86bad49ec1f787a4f69a77ccffa06e4967d0c796 (diff)
Rollup merge of #40226 - jdhorwitz:master, r=frewsxcv
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
-rw-r--r--src/libcollections/string.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index 4979107ccad..43323676ab4 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -433,6 +433,10 @@ impl String {
     ///
     /// [`str::from_utf8()`]: ../../std/str/fn.from_utf8.html
     ///
+    /// The inverse of this method is [`as_bytes`].
+    ///
+    /// [`as_bytes`]: #method.as_bytes
+    ///
     /// # Errors
     ///
     /// Returns `Err` if the slice is not UTF-8 with a description as to why the
@@ -979,6 +983,10 @@ impl String {
 
     /// Returns a byte slice of this `String`'s contents.
     ///
+    /// The inverse of this method is [`from_utf8`].
+    ///
+    /// [`from_utf8`]: #method.from_utf8
+    ///
     /// # Examples
     ///
     /// Basic usage: