Skip to content

Commit ee3d711

Browse files
committed
chore: use is_whitespace to check whitespace
1 parent 77bd66f commit ee3d711

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/string/isogram.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn count_letters(s: &str) -> Result<HashMap<char, usize>, IsogramError> {
3232
let mut letter_counts = HashMap::new();
3333

3434
for ch in s.to_ascii_lowercase().chars() {
35-
if !ch.is_ascii_alphabetic() && ch != ' ' {
35+
if !ch.is_ascii_alphabetic() && !ch.is_whitespace() {
3636
return Err(IsogramError::NonAlphabeticCharacter);
3737
}
3838

0 commit comments

Comments
 (0)