From 667a24644270ba9b76a8413cd5bf5ccc49ad12cd Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 13 Jun 2015 00:37:32 +0200 Subject: [PATCH] doc: make char::from_u32 example more brief --- src/libcore/char.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 9938c2996158a..df371752b8651 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -74,17 +74,8 @@ pub const MAX: char = '\u{10ffff}'; /// ``` /// use std::char; /// -/// let c = char::from_u32(10084); // produces `Some(❤)` -/// assert_eq!(c, Some('❤')); -/// ``` -/// -/// An invalid character: -/// -/// ``` -/// use std::char; -/// -/// let none = char::from_u32(1114112); -/// assert_eq!(none, None); +/// assert_eq!(char::from_u32(0x2764), Some('❤')); +/// assert_eq!(char::from_u32(0x110000), None); // invalid character /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")]