WIP
This commit is contained in:
+3
-3
@@ -132,7 +132,7 @@ impl AnyAction for () {
|
||||
#[macro_export]
|
||||
macro_rules! action {
|
||||
($name:ident, $arg:ty) => {
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct $name(pub $arg);
|
||||
|
||||
impl $crate::Action for $name {
|
||||
@@ -3677,13 +3677,13 @@ mod tests {
|
||||
});
|
||||
|
||||
let actions_clone = actions.clone();
|
||||
cx.add_action(move |view: &mut ViewB, action: &Action, cx| {
|
||||
cx.add_action(move |view: &mut ViewB, _: &Action, cx| {
|
||||
cx.propagate_action();
|
||||
actions_clone.borrow_mut().push(format!("{} c", view.id));
|
||||
});
|
||||
|
||||
let actions_clone = actions.clone();
|
||||
cx.add_action(move |view: &mut ViewB, action: &Action, cx| {
|
||||
cx.add_action(move |view: &mut ViewB, _: &Action, cx| {
|
||||
cx.propagate_action();
|
||||
actions_clone.borrow_mut().push(format!("{} d", view.id));
|
||||
});
|
||||
|
||||
+8
-1
@@ -419,6 +419,13 @@ mod tests {
|
||||
action!(B);
|
||||
action!(Ab);
|
||||
|
||||
impl PartialEq for A {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.0 == other.0
|
||||
}
|
||||
}
|
||||
impl Eq for A {}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
struct ActionArg {
|
||||
a: &'static str,
|
||||
@@ -465,7 +472,7 @@ mod tests {
|
||||
}
|
||||
|
||||
impl Matcher {
|
||||
fn test_keystroke<A: Action>(
|
||||
fn test_keystroke<A: Action + Eq>(
|
||||
&mut self,
|
||||
keystroke: &str,
|
||||
view_id: usize,
|
||||
|
||||
Reference in New Issue
Block a user