Skip to content

Commit d34c6ee

Browse files
committed
Use a character that requires two u16s in the examples for char.encode_utf16()
1 parent 60ce31a commit d34c6ee

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustc_unicode/char.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -457,26 +457,26 @@ impl char {
457457
///
458458
/// # Examples
459459
///
460-
/// In both of these examples, 'ß' takes one `u16` to encode.
460+
/// In both of these examples, '𝕊' takes two `u16`s to encode.
461461
///
462462
/// ```
463463
/// #![feature(unicode)]
464464
///
465-
/// let mut b = [0; 1];
465+
/// let mut b = [0; 2];
466466
///
467-
/// let result = 'ß'.encode_utf16(&mut b);
467+
/// let result = '𝕊'.encode_utf16(&mut b);
468468
///
469-
/// assert_eq!(result, Some(1));
469+
/// assert_eq!(result, Some(2));
470470
/// ```
471471
///
472472
/// A buffer that's too small:
473473
///
474474
/// ```
475475
/// #![feature(unicode)]
476476
///
477-
/// let mut b = [0; 0];
477+
/// let mut b = [0; 1];
478478
///
479-
/// let result = 'ß'.encode_utf16(&mut b);
479+
/// let result = '𝕊'.encode_utf16(&mut b);
480480
///
481481
/// assert_eq!(result, None);
482482
/// ```

0 commit comments

Comments
 (0)