Skip to content

Commit 50de1d6

Browse files
committed
doc: improve escape_unicode example
Looks better without all that wasted whitespace
1 parent 1671b9b commit 50de1d6

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/librustc_unicode/char.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,15 @@ impl char {
188188
///
189189
/// ```
190190
/// for i in '❤'.escape_unicode() {
191-
/// println!("{}", i);
191+
/// print!("{}", i);
192192
/// }
193+
/// println!("");
193194
/// ```
194195
///
195196
/// This prints:
196197
///
197198
/// ```text
198-
/// \
199-
/// u
200-
/// {
201-
/// 2
202-
/// 7
203-
/// 6
204-
/// 4
205-
/// }
199+
/// \u{2764}
206200
/// ```
207201
///
208202
/// Collecting into a `String`:

0 commit comments

Comments
 (0)