diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-27 19:27:15 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-27 19:27:15 +0100 |
| commit | c7c135f25ee00e40fb5f34b49bdcdcbfc2f67f87 (patch) | |
| tree | 31692e72188591dee23025545b0b933cfeb5c6c6 /src/model | |
| parent | a96141a3ea9d1b11ef4cdc924216d8979689e6f0 (diff) | |
Add `variants` method to symbol
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/symbol.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/model/symbol.rs b/src/model/symbol.rs index ac1d2b10..686f1b81 100644 --- a/src/model/symbol.rs +++ b/src/model/symbol.rs @@ -81,12 +81,12 @@ impl Symbol { } /// The characters that are covered by this symbol. - pub fn chars(&self) -> impl Iterator<Item = char> { + pub fn variants(&self) -> impl Iterator<Item = (&str, char)> { let (first, slice) = match self.repr { - Repr::Single(c) => (Some(c), [].as_slice()), + Repr::Single(c) => (Some(("", c)), [].as_slice()), Repr::List(list) => (None, list), }; - first.into_iter().chain(slice.iter().map(|&(_, c)| c)) + first.into_iter().chain(slice.iter().copied()) } /// Possible modifiers. |
