Restore erronously removed APIs

This commit is contained in:
Mikayla 2024-01-21 14:33:34 -08:00
parent 660a391806
commit 118a3461a7
No known key found for this signature in database

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) {