Skip to content

Commit

Permalink
chore: use is_whitespace to check whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
sozelfist committed Oct 13, 2024
1 parent 77bd66f commit ee3d711
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/string/isogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn count_letters(s: &str) -> Result<HashMap<char, usize>, IsogramError> {
let mut letter_counts = HashMap::new();

for ch in s.to_ascii_lowercase().chars() {
if !ch.is_ascii_alphabetic() && ch != ' ' {
if !ch.is_ascii_alphabetic() && !ch.is_whitespace() {
return Err(IsogramError::NonAlphabeticCharacter);
}

Expand Down

0 comments on commit ee3d711

Please sign in to comment.