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