diff options
| author | Botahamec <botahamec@outlook.com> | 2023-08-02 22:09:09 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2023-08-02 22:09:09 -0400 |
| commit | 392a88dd422431829d9146b41cd6e2dd51060833 (patch) | |
| tree | 67057f508302045d580a0d66e98e7458384c0099 | |
| parent | 144e080d03fb7bb2e2958dab90a10f36673f1491 (diff) | |
Create the ascii whitespace cset
| -rw-r--r-- | src/csets.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/csets.rs b/src/csets.rs index ee4cdcb..3ee5e53 100644 --- a/src/csets.rs +++ b/src/csets.rs @@ -154,6 +154,16 @@ impl CharacterSet for AsciiDigits { } } +/// Contains the ASCII whitespace characters +#[derive(Debug, Clone, Copy)] +pub struct AsciiWhitespace; + +impl CharacterSet for AsciiWhitespace { + fn contains(&self, ch: char) -> bool { + ch.is_ascii_whitespace() + } +} + /// Contains all lowercase ASCII letters, a-z #[derive(Debug, Clone, Copy)] pub struct AsciiLowercase; |
