Restore erronously removed APIs

This commit is contained in:
Mikayla committed 2024-01-21 14:33:34 -08:00
1 parent 5383377472
commit 91ecd8a9ad
1 file changed
+15
+15
View File
@@ -96,6 +96,21 @@ pub enum KeyMatch {
Some(Vec<Box<dyn Action>>),
}
impl KeyMatch {
/// Returns true if the match is complete.
pub fn is_some(&self) -> bool {
matches!(self, KeyMatch::Some(_))
}
/// Get the matches if the match is complete.
pub fn matches(self) -> Option<Vec<Box<dyn Action>>> {
match self {
KeyMatch::Some(matches) => Some(matches),
_ => None,
}
}
}
impl PartialEq for KeyMatch {
fn eq(&self, other: &Self) -> bool {
match (self, other) {