summaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/tui_menu.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-16 16:14:17 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-16 16:14:17 -0400
commitc6edd4e5d5cbcbc16063a10181aee9626822d273 (patch)
tree5524d52e5fb6f288be943c4882973dd1839a95f3 /src/ui/widgets/tui_menu.rs
parent50f67156b783c3f533214ddfa8e79bd979d76278 (diff)
better error handling for threads
- code cleanup
Diffstat (limited to 'src/ui/widgets/tui_menu.rs')
-rw-r--r--src/ui/widgets/tui_menu.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ui/widgets/tui_menu.rs b/src/ui/widgets/tui_menu.rs
index 4088d6d..efa8d7d 100644
--- a/src/ui/widgets/tui_menu.rs
+++ b/src/ui/widgets/tui_menu.rs
@@ -80,17 +80,15 @@ impl TuiCommandMenu {
Event::Input(key) => {
match key {
Key::Esc => return None,
- key => {
- match map.get(&key) {
- Some(CommandKeybind::SimpleKeybind(s)) => {
- return Some(s);
- }
- Some(CommandKeybind::CompositeKeybind(m)) => {
- map = m;
- }
- None => return None,
+ key => match map.get(&key) {
+ Some(CommandKeybind::SimpleKeybind(s)) => {
+ return Some(s);
}
- }
+ Some(CommandKeybind::CompositeKeybind(m)) => {
+ map = m;
+ }
+ None => return None,
+ },
}
context.events.flush();
}