about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-02-25 11:41:02 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-02-25 15:06:07 +0530
commit39f41c64f9903070d1b4ffd214de8936d924132b (patch)
treecd28852bbc56a27e1d9097a6ca892de99cc24989
parent4cfa2ee2f125f513afea0690a71d313d67e6acb3 (diff)
parentd34c6eeed49acb227bbd07db9d321319cec5dd56 (diff)
downloadrust-39f41c64f9903070d1b4ffd214de8936d924132b.tar.gz
rust-39f41c64f9903070d1b4ffd214de8936d924132b.zip
Rollup merge of #31831 - tormol:master, r=alexcrichton
The "A buffer that's too small" example was calling encode_utf**8**().
-rw-r--r--src/librustc_unicode/char.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs
index a489b4991f4..11500286755 100644
--- a/src/librustc_unicode/char.rs
+++ b/src/librustc_unicode/char.rs
@@ -457,16 +457,16 @@ impl char {
     ///
     /// # Examples
     ///
-    /// In both of these examples, 'ß' takes one `u16` to encode.
+    /// In both of these examples, '𝕊' takes two `u16`s to encode.
     ///
     /// ```
     /// #![feature(unicode)]
     ///
-    /// let mut b = [0; 1];
+    /// let mut b = [0; 2];
     ///
-    /// let result = 'ß'.encode_utf16(&mut b);
+    /// let result = '𝕊'.encode_utf16(&mut b);
     ///
-    /// assert_eq!(result, Some(1));
+    /// assert_eq!(result, Some(2));
     /// ```
     ///
     /// A buffer that's too small:
@@ -474,9 +474,9 @@ impl char {
     /// ```
     /// #![feature(unicode)]
     ///
-    /// let mut b = [0; 0];
+    /// let mut b = [0; 1];
     ///
-    /// let result = 'ß'.encode_utf8(&mut b);
+    /// let result = '𝕊'.encode_utf16(&mut b);
     ///
     /// assert_eq!(result, None);
     /// ```