diff options
| author | Botahamec <botahamec@outlook.com> | 2023-07-29 21:53:22 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2023-07-29 21:53:22 -0400 |
| commit | 6606790896f7106c6a9529483753a26a22c62814 (patch) | |
| tree | 008316994219504bf53b837266c9ecf51e7111ff | |
| parent | c0ad3ae92d6d26410e160113fe0bbf3ab87f7c1f (diff) | |
Add character as a CharacterSet
| -rw-r--r-- | src/csets.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/csets.rs b/src/csets.rs index 0d33bd9..8c6767c 100644 --- a/src/csets.rs +++ b/src/csets.rs @@ -52,6 +52,12 @@ impl CharacterSet for AsciiLetters { } } +impl CharacterSet for char { + fn contains(&self, ch: char) -> bool { + *self == ch + } +} + impl CharacterSet for &[char] { fn contains(&self, ch: char) -> bool { (self as &[char]).contains(&ch) |
