We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d2c223a + 667a246 commit d24dd31Copy full SHA for d24dd31
src/libcore/char.rs
@@ -74,17 +74,8 @@ pub const MAX: char = '\u{10ffff}';
74
/// ```
75
/// use std::char;
76
///
77
-/// let c = char::from_u32(10084); // produces `Some(❤)`
78
-/// assert_eq!(c, Some('❤'));
79
-/// ```
80
-///
81
-/// An invalid character:
82
83
84
-/// use std::char;
85
86
-/// let none = char::from_u32(1114112);
87
-/// assert_eq!(none, None);
+/// assert_eq!(char::from_u32(0x2764), Some('❤'));
+/// assert_eq!(char::from_u32(0x110000), None); // invalid character
88
89
#[inline]
90
#[stable(feature = "rust1", since = "1.0.0")]
0 commit comments