diff --git a/examples/hello.rs b/examples/hello.rs index 725618411..e800f1951 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -38,7 +38,7 @@ fn main() -> Result<(), Error> { buf.terminal().set_raw_mode()?; loop { - match buf.terminal().poll_input(Blocking::Yes) { + match buf.terminal().poll_input(Blocking::Wait) { Ok(Some(input)) => match input { InputEvent::Key(KeyEvent { key: KeyCode::Escape, diff --git a/src/terminal/mod.rs b/src/terminal/mod.rs index 17728119a..4bab21699 100644 --- a/src/terminal/mod.rs +++ b/src/terminal/mod.rs @@ -41,8 +41,8 @@ pub struct ScreenSize { #[derive(Debug, Clone, Copy)] pub enum Blocking { - No, - Yes, + DoNotWait, + Wait, } /// `Terminal` abstracts over some basic terminal capabilities. diff --git a/src/terminal/unix.rs b/src/terminal/unix.rs index 5907c8a6f..e5cd3eebb 100644 --- a/src/terminal/unix.rs +++ b/src/terminal/unix.rs @@ -94,8 +94,8 @@ impl TtyReadHandle { fn set_blocking(&mut self, blocking: Blocking) -> Result<(), Error> { let value: libc::c_int = match blocking { - Blocking::Yes => 0, - Blocking::No => 1, + Blocking::Wait => 0, + Blocking::DoNotWait => 1, }; if unsafe { libc::ioctl(*self.fd, libc::FIONBIO, &value as *const _) } != 0 { bail!("failed to ioctl(FIONBIO): {:?}", IoError::last_os_error()); diff --git a/src/terminal/windows.rs b/src/terminal/windows.rs index 8b12ca143..610090dbd 100644 --- a/src/terminal/windows.rs +++ b/src/terminal/windows.rs @@ -449,8 +449,8 @@ impl Terminal for WindowsTerminal { } let pending = match (self.input_handle.get_number_of_input_events()?, blocking) { - (0, Blocking::No) => return Ok(None), - (0, Blocking::Yes) => 1, + (0, Blocking::DoNotWait) => return Ok(None), + (0, Blocking::Wait) => 1, (pending, _) => pending, };