mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 19:56:44 +01:00
simplify
This commit is contained in:
parent
291b917970
commit
238ac2e888
25 changed files with 1018 additions and 1147 deletions
|
|
@ -7,7 +7,7 @@ use crate::*;
|
|||
///
|
||||
/// When a key is pressed, the bindings for it are checked in sequence.
|
||||
/// When the first non-conditional or true conditional binding is executed,
|
||||
/// that binding's value is returned.
|
||||
/// that .event()binding's value is returned.
|
||||
#[derive(Debug)] pub struct EventMap<E, D: Dsl>(
|
||||
/// Map of each event (e.g. key combination) to
|
||||
/// all command expressions bound to it by
|
||||
|
|
@ -71,7 +71,7 @@ impl<E: Ord + Debug + From<Arc<str>> + Clone> EventMap<E, Ast> {
|
|||
}
|
||||
/// Evaluate the active layers for a given state,
|
||||
/// returning the command to be executed, if any.
|
||||
pub fn handle <S, O> (&self, state: &mut S, event: Ast) -> Perhaps<O> where
|
||||
pub fn handle <S, O> (&self, state: &mut S, event: &E) -> Perhaps<O> where
|
||||
S: DslInto<bool> + DslInto<O>,
|
||||
O: Command<S>
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue