From ee3d71184ffd782327a152b89bc22af4db1b5467 Mon Sep 17 00:00:00 2001 From: Truong Nhan Nguyen Date: Sun, 13 Oct 2024 21:06:11 +0700 Subject: [PATCH] chore: use is_whitespace to check whitespace --- src/string/isogram.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string/isogram.rs b/src/string/isogram.rs index 1be6020cbc5..30b8d66bdff 100644 --- a/src/string/isogram.rs +++ b/src/string/isogram.rs @@ -32,7 +32,7 @@ fn count_letters(s: &str) -> Result, 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); }