Skip to content

Commit

Permalink
Use u32::from for MIN/MAX examples
Browse files Browse the repository at this point in the history
  • Loading branch information
clarfonthey committed Jul 31, 2023
1 parent b64f3c7 commit 0165a4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/core/src/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl char {
/// let c: char = something_which_returns_char();
/// assert!(char::MIN <= c);
///
/// let value_at_min = char::MIN as u32;
/// let value_at_min = u32::from(char::MIN);
/// assert_eq!(char::from_u32(value_at_min), Some('\0'));
/// ```
#[unstable(feature = "char_min", issue = "114298")]
Expand Down Expand Up @@ -68,7 +68,7 @@ impl char {
/// let c: char = something_which_returns_char();
/// assert!(c <= char::MAX);
///
/// let value_at_max = char::MAX as u32;
/// let value_at_max = u32::from(char::MAX);
/// assert_eq!(char::from_u32(value_at_max), Some('\u{10FFFF}'));
/// assert_eq!(char::from_u32(value_at_max + 1), None);
/// ```
Expand Down

0 comments on commit 0165a4c

Please sign in to comment.