mirror of
https://github.com/crossterm-rs/crossterm.git
synced 2025-05-05 15:32:57 +00:00
fix: fmt (#969)
This commit is contained in:
parent
e063091312
commit
2c18768d2c
@ -5,7 +5,10 @@
|
||||
|
||||
use std::io;
|
||||
|
||||
use crossterm::{event::{self, Event, KeyCode, KeyEvent, KeyEventKind}, terminal};
|
||||
use crossterm::{
|
||||
event::{self, Event, KeyCode, KeyEvent, KeyEventKind},
|
||||
terminal,
|
||||
};
|
||||
|
||||
pub fn read_char() -> io::Result<char> {
|
||||
loop {
|
||||
@ -23,11 +26,12 @@ pub fn read_char() -> io::Result<char> {
|
||||
pub fn read_line() -> io::Result<String> {
|
||||
let mut line = String::new();
|
||||
loop {
|
||||
if let Event::Key(KeyEvent{
|
||||
if let Event::Key(KeyEvent {
|
||||
code,
|
||||
kind: KeyEventKind::Press,
|
||||
..
|
||||
}) = event::read()? {
|
||||
}) = event::read()?
|
||||
{
|
||||
match code {
|
||||
KeyCode::Enter => {
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user