mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-26 17:40:37 +00:00
tui_event: unwrap result of stdin.keys()
Clear a clippy warning about manual flatten. This isn't good error handling, but panicking is probably better than spinning forever if stdin returns EOF.
This commit is contained in:
committed by
Eric Seppanen
parent
bf56ea8c43
commit
7a3794ef18
@@ -54,14 +54,14 @@ impl Events {
|
||||
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;
|
||||
}
|
||||
if !ignore_exit_key.load(Ordering::Relaxed) && key == config.exit_key {
|
||||
return;
|
||||
}
|
||||
// This will panic if stdin returns EOF.
|
||||
let key = evt.unwrap();
|
||||
if let Err(err) = tx.send(Event::Input(key)) {
|
||||
eprintln!("{}", err);
|
||||
return;
|
||||
}
|
||||
if !ignore_exit_key.load(Ordering::Relaxed) && key == config.exit_key {
|
||||
return;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user