This commit is contained in:
Austin Schey 2025-02-04 21:37:16 -08:00 committed by GitHub
parent e063091312
commit 2c18768d2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {
@ -27,7 +30,8 @@ pub fn read_line() -> io::Result<String> {
code,
kind: KeyEventKind::Press,
..
}) = event::read()? {
}) = event::read()?
{
match code {
KeyCode::Enter => {
break;