str_utils/
is_uppercased.rs

1/// To extend `str` to have `is_uppercased` method.
2pub trait IsUppercased {
3    /// Returns `true` if all characters in the string are not lowercase according to Unicode.
4    fn is_uppercased(&self) -> bool;
5}
6
7impl IsUppercased for str {
8    #[inline]
9    fn is_uppercased(&self) -> bool {
10        self.chars().all(|c| !c.is_lowercase())
11    }
12}