about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTshepang Lekhonkhobe <tshepang@gmail.com>2015-06-12 23:58:32 +0200
committerTshepang Lekhonkhobe <tshepang@gmail.com>2015-06-12 23:58:50 +0200
commit50de1d6e716d06dbb4ea8d59707bf827445e0a48 (patch)
treec4e5045ae4b4fc7219de2395a297012f00a40c2a
parent1671b9baeceeb38ddb7366668d28e3a7ee839ef3 (diff)
doc: improve escape_unicode example
Looks better without all that wasted whitespace
-rw-r--r--src/librustc_unicode/char.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs
index 946a833b3f8..afe7c8bd3b5 100644
--- a/src/librustc_unicode/char.rs
+++ b/src/librustc_unicode/char.rs
@@ -188,21 +188,15 @@ impl char {
     ///
     /// ```
     /// for i in '❤'.escape_unicode() {
-    ///     println!("{}", i);
+    ///     print!("{}", i);
     /// }
+    /// println!("");
     /// ```
     ///
     /// This prints:
     ///
     /// ```text
-    /// \
-    /// u
-    /// {
-    /// 2
-    /// 7
-    /// 6
-    /// 4
-    /// }
+    /// \u{2764}
     /// ```
     ///
     /// Collecting into a `String`: