aboutsummaryrefslogtreecommitdiff
path: root/src/util/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/event.rs')
-rw-r--r--src/util/event.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/util/event.rs b/src/util/event.rs
index 33ee9ec..05d8581 100644
--- a/src/util/event.rs
+++ b/src/util/event.rs
@@ -43,12 +43,10 @@ impl Events {
let tx = tx.clone();
thread::spawn(move || {
let stdin = io::stdin();
- for evt in stdin.keys() {
- if let Ok(key) = evt {
- if let Err(err) = tx.send(Event::Input(key)) {
- eprintln!("{}", err);
- return;
- }
+ for key in stdin.keys().flatten() {
+ if let Err(err) = tx.send(Event::Input(key)) {
+ eprintln!("{}", err);
+ return;
}
}
})