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