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_lowercased` method.
pub trait IsLowercased {
    /// Returns `true` if all characters in the string are not uppercase according to Unicode.
    fn is_lowercased(&self) -> bool;
}

impl IsLowercased for str {
    #[inline]
    fn is_lowercased(&self) -> bool {
        self.chars().all(|c| !c.is_uppercase())
    }
}