We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b64f3c7 commit 0165a4cCopy full SHA for 0165a4c
library/core/src/char/methods.rs
@@ -36,7 +36,7 @@ impl char {
36
/// let c: char = something_which_returns_char();
37
/// assert!(char::MIN <= c);
38
///
39
- /// let value_at_min = char::MIN as u32;
+ /// let value_at_min = u32::from(char::MIN);
40
/// assert_eq!(char::from_u32(value_at_min), Some('\0'));
41
/// ```
42
#[unstable(feature = "char_min", issue = "114298")]
@@ -68,7 +68,7 @@ impl char {
68
69
/// assert!(c <= char::MAX);
70
71
- /// let value_at_max = char::MAX as u32;
+ /// let value_at_max = u32::from(char::MAX);
72
/// assert_eq!(char::from_u32(value_at_max), Some('\u{10FFFF}'));
73
/// assert_eq!(char::from_u32(value_at_max + 1), None);
74
0 commit comments