Skip to content

Commit 023f661

Browse files
committed
Rollup merge of #26260 - tshepang:improve-example, r=steveklabnik
2 parents 4935ea9 + 2c08654 commit 023f661

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/librustc_unicode/char.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,16 @@ impl char {
187187
/// # Examples
188188
///
189189
/// ```
190-
/// for i in '❤'.escape_unicode() {
191-
/// println!("{}", i);
190+
/// for c in '❤'.escape_unicode() {
191+
/// print!("{}", c);
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)