Commit 8cf6c5f9 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

syntax: Let older rustc understand symbolmap's lifetime

parent de3bf54d
Pipeline #59502 passed with stages
in 45 minutes and 19 seconds
......@@ -386,38 +386,36 @@ impl Layout {
extract_symbol_names(&button_actions)
);
let button_states = button_actions.into_iter().map(|(name, action)| {
let keycodes = match &action {
::action::Action::Submit { text: _, keys } => {
keys.iter().map(|named_keysym| {
*symbolmap.get(named_keysym.0.as_str())
.expect(
format!(
"keysym {} in key {} missing from symbol map",
named_keysym.0,
name
).as_str()
)
}).collect()
},
action::Action::Erase => vec![
*symbolmap.get("BackSpace")
.expect(&format!("BackSpace missing from symbol map")),
],
_ => Vec::new(),
};
(
name.into(),
KeyState {
pressed: PressType::Released,
keycodes,
action,
}
)
});
let button_states = HashMap::<String, KeyState>::from_iter(
button_states
button_actions.into_iter().map(|(name, action)| {
let keycodes = match &action {
::action::Action::Submit { text: _, keys } => {
keys.iter().map(|named_keysym| {
*symbolmap.get(named_keysym.0.as_str())
.expect(
format!(
"keysym {} in key {} missing from symbol map",
named_keysym.0,
name
).as_str()
)
}).collect()
},
action::Action::Erase => vec![
*symbolmap.get("BackSpace")
.expect(&format!("BackSpace missing from symbol map")),
],
_ => Vec::new(),
};
(
name.into(),
KeyState {
pressed: PressType::Released,
keycodes,
action,
}
)
})
);
let keymap_str = match generate_keymap(symbolmap) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment