str-utils 0.3.1

This crate provides some traits to extend `[u8]`, `str` and `Cow<str>`.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
/// To extend `str` to have `is_uppercased` method.
pub trait IsUppercased {
    /// Returns `true` if all characters in the string are not lowercase according to Unicode.
    fn is_uppercased(&self) -> bool;
}

impl IsUppercased for str {
    #[inline]
    fn is_uppercased(&self) -> bool {
        self.chars().all(|c| !c.is_lowercase())
    }
}