diff options
Diffstat (limited to 'src/config/keymap/keymap_store.rs')
| -rw-r--r-- | src/config/keymap/keymap_store.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/config/keymap/keymap_store.rs b/src/config/keymap/keymap_store.rs index c782219..233ac52 100644 --- a/src/config/keymap/keymap_store.rs +++ b/src/config/keymap/keymap_store.rs @@ -48,17 +48,16 @@ pub trait Runnable where Self: Send, { - fn run(&self) -> Result<()>; + fn run(&self) -> Result<bool>; } impl<T> Runnable for T where - T: Fn(), + T: Fn() -> bool, Self: Send, { - fn run(&self) -> Result<()> { - self(); - Ok(()) + fn run(&self) -> Result<bool> { + Ok(self()) } } @@ -66,11 +65,10 @@ impl Runnable for RegistryKey where Self: Send, { - fn run(&self) -> Result<()> { + fn run(&self) -> Result<bool> { let lua = lua::get(); let func: Function = lua.registry_value(self)?; - func.call::<(), ()>(())?; - Ok(()) + Ok(func.call::<(), bool>(()).unwrap_or(false)) } } |