From 50de1d6e716d06dbb4ea8d59707bf827445e0a48 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Fri, 12 Jun 2015 23:58:32 +0200 Subject: [PATCH 1/2] doc: improve escape_unicode example Looks better without all that wasted whitespace --- src/librustc_unicode/char.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs index 946a833b3f864..afe7c8bd3b582 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`: From 2c08654e0936f6b6ecd174a6b261854effec30b9 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 13 Jun 2015 00:01:16 +0200 Subject: [PATCH 2/2] doc: 'c' feels more suitable than 'i' for representing characters --- src/librustc_unicode/char.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs index afe7c8bd3b582..68f2488702c73 100644 --- a/src/librustc_unicode/char.rs +++ b/src/librustc_unicode/char.rs @@ -187,8 +187,8 @@ impl char { /// # Examples /// /// ``` - /// for i in '❤'.escape_unicode() { - /// print!("{}", i); + /// for c in '❤'.escape_unicode() { + /// print!("{}", c); /// } /// println!(""); /// ```