diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index c5eccf2998f3b..feb8ee2bbda21 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -19,7 +19,7 @@ impl char { /// ``` /// #![feature(char_min)] /// let dist = u32::from(char::MAX) - u32::from(char::MIN); - /// let size = (char::MIN..=char::MAX).count(); + /// let size = (char::MIN..=char::MAX).count() as u32; /// assert!(dist < size); /// ``` /// @@ -52,7 +52,7 @@ impl char { /// ``` /// #![feature(char_min)] /// let dist = u32::from(char::MAX) - u32::from(char::MIN); - /// let size = (char::MIN..=char::MAX).count(); + /// let size = (char::MIN..=char::MAX).count() as u32; /// assert!(dist < size); /// ``` ///