]> git.lizzy.rs Git - rust.git/commitdiff
Correct char.encode_utf16() documentation
authortormol <t.b.moltu@lyse.net>
Tue, 23 Feb 2016 04:55:49 +0000 (05:55 +0100)
committertormol <t.b.moltu@lyse.net>
Tue, 23 Feb 2016 05:01:33 +0000 (06:01 +0100)
The "A buffer that's too small" example was calling encode_utf8().

src/librustc_unicode/char.rs

index a489b4991f4b650c81160f3168ea872b26e128e9..20f4687f2f429cd6431d117b94caf8e952767bab 100644 (file)
@@ -476,7 +476,7 @@ pub fn encode_utf8(self, dst: &mut [u8]) -> Option<usize> {
     ///
     /// let mut b = [0; 0];
     ///
-    /// let result = 'ß'.encode_utf8(&mut b);
+    /// let result = 'ß'.encode_utf16(&mut b);
     ///
     /// assert_eq!(result, None);
     /// ```