From c7c135f25ee00e40fb5f34b49bdcdcbfc2f67f87 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 27 Jan 2023 19:27:15 +0100 Subject: [PATCH] Add `variants` method to symbol --- src/model/symbol.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/model/symbol.rs b/src/model/symbol.rs index ac1d2b100..686f1b815 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 { + pub fn variants(&self) -> impl Iterator { 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.