Skip to content

Commit

Permalink
Rollup merge of rust-lang#31831 - tormol:master, r=alexcrichton
Browse files Browse the repository at this point in the history
The "A buffer that's too small" example was calling encode_utf**8**().
  • Loading branch information
Manishearth committed Feb 25, 2016
2 parents 4cfa2ee + d34c6ee commit 39f41c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/librustc_unicode/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,26 +457,26 @@ impl char {
///
/// # Examples
///
/// In both of these examples, 'ß' takes one `u16` to encode.
/// In both of these examples, '𝕊' takes two `u16`s to encode.
///
/// ```
/// #![feature(unicode)]
///
/// let mut b = [0; 1];
/// let mut b = [0; 2];
///
/// let result = 'ß'.encode_utf16(&mut b);
/// let result = '𝕊'.encode_utf16(&mut b);
///
/// assert_eq!(result, Some(1));
/// assert_eq!(result, Some(2));
/// ```
///
/// A buffer that's too small:
///
/// ```
/// #![feature(unicode)]
///
/// let mut b = [0; 0];
/// let mut b = [0; 1];
///
/// let result = 'ß'.encode_utf8(&mut b);
/// let result = '𝕊'.encode_utf16(&mut b);
///
/// assert_eq!(result, None);
/// ```
Expand Down

0 comments on commit 39f41c6

Please sign in to comment.