diff --git a/crates/pacdef_core/src/ui.rs b/crates/pacdef_core/src/ui.rs index 5b64622..d872899 100644 --- a/crates/pacdef_core/src/ui.rs +++ b/crates/pacdef_core/src/ui.rs @@ -33,13 +33,11 @@ pub fn read_single_char_from_terminal() -> Result { new_termios.c_cc[VTIME] = 0; tcsetattr(fd, TCSANOW, &new_termios).context("setting terminal mode")?; - let mut input = [0u8; 1]; + let mut input_buffer = [0u8; 1]; io::stdin() - .read_exact(&mut input[..]) + .read_exact(&mut input_buffer[..]) .context("reading one byte from stdin")?; - let result: char = input[0] - .try_into() - .context("reading a single byte from stdin")?; + let result: char = input_buffer[0].into(); // stdin is not echoed automatically in this terminal mode println!("{result}");