summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2023-07-29 21:53:22 -0400
committerBotahamec <botahamec@outlook.com>2023-07-29 21:53:22 -0400
commit6606790896f7106c6a9529483753a26a22c62814 (patch)
tree008316994219504bf53b837266c9ecf51e7111ff
parentc0ad3ae92d6d26410e160113fe0bbf3ab87f7c1f (diff)
Add character as a CharacterSet
-rw-r--r--src/csets.rs6
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)