Skip to content

Commit

Permalink
fix: fmt (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschey authored Feb 5, 2025
1 parent e063091 commit 2c18768
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/event-read-char-line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit 2c18768

Please sign in to comment.