Skip to content

Commit 60ce31a

Browse files
committed
Correct char.encode_utf16() documentation
The "A buffer that's too small" example was calling encode_utf8().
1 parent c8fc481 commit 60ce31a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_unicode/char.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ impl char {
476476
///
477477
/// let mut b = [0; 0];
478478
///
479-
/// let result = 'ß'.encode_utf8(&mut b);
479+
/// let result = 'ß'.encode_utf16(&mut b);
480480
///
481481
/// assert_eq!(result, None);
482482
/// ```

0 commit comments

Comments
 (0)