mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 18:46:49 +00:00
Restore erronously removed APIs
This commit is contained in:
parent
660a391806
commit
118a3461a7
1 changed files with 15 additions and 0 deletions
|
@ -96,6 +96,21 @@ pub enum KeyMatch {
|
||||||
Some(Vec<Box<dyn Action>>),
|
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 {
|
impl PartialEq for KeyMatch {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
|
|
Loading…
Reference in a new issue