tidy up the hello program a tiny bit
This commit is contained in:
1 parent
11a32f7d99
commit
cba05e3942
1 file changed
+8
-1
+8
-1
@@ -41,11 +41,18 @@ fn main() -> Result<(), Error> {
|
||||
match buf.terminal().poll_input(Blocking::Yes) {
|
||||
Ok(Some(input)) => match input {
|
||||
InputEvent::Key(KeyEvent {
|
||||
key: KeyCode::Char('q'),
|
||||
key: KeyCode::Escape,
|
||||
..
|
||||
}) => {
|
||||
break;
|
||||
}
|
||||
InputEvent::Key(KeyEvent {
|
||||
key: KeyCode::Char(c),
|
||||
..
|
||||
}) => {
|
||||
buf.add_change(format!("{}", c));
|
||||
buf.flush()?;
|
||||
}
|
||||
_ => {
|
||||
print!("{:?}\r\n", input);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user