config: move parsed model into schema crate
This commit is contained in:
parent
c8a6b69bf1
commit
a038855895
8 changed files with 266 additions and 239 deletions
|
|
@ -128,7 +128,17 @@ impl FnBuilder for ShortcutFnBuilder<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl Action {
|
||||
trait ActionExt {
|
||||
fn into_fn(self, state: &Rc<State>) -> Box<dyn Fn()>;
|
||||
|
||||
fn into_rc_fn(self, state: &Rc<State>) -> Rc<dyn Fn()>;
|
||||
|
||||
fn into_shortcut_fn(self, state: &Rc<State>) -> Rc<dyn Fn()>;
|
||||
|
||||
fn into_fn_impl<B: FnBuilder>(self, b: &B, state: &Rc<State>) -> B::Output;
|
||||
}
|
||||
|
||||
impl ActionExt for Action {
|
||||
fn into_fn(self, state: &Rc<State>) -> Box<dyn Fn()> {
|
||||
self.into_fn_impl(&BoxFnBuilder, state)
|
||||
}
|
||||
|
|
@ -723,7 +733,11 @@ impl InputMatchExt for InputMatch {
|
|||
}
|
||||
}
|
||||
|
||||
impl Input {
|
||||
trait InputExt {
|
||||
fn apply(&self, c: InputDevice, state: &State);
|
||||
}
|
||||
|
||||
impl InputExt for Input {
|
||||
fn apply(&self, c: InputDevice, state: &State) {
|
||||
if let Some(v) = self.accel_profile {
|
||||
c.set_accel_profile(v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue