diff options
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/input.rs b/src/input.rs index f24f9c3..961fc51 100644 --- a/src/input.rs +++ b/src/input.rs @@ -15,12 +15,12 @@ impl RawGuard { /// [`Input::new`](Input::new). /// /// # Errors - /// * `Error::SetRaw`: failed to put the terminal into raw mode + /// * `Error::SetTerminalMode`: failed to put the terminal into raw mode pub async fn new() -> crate::error::Result<Self> { let stdin = std::io::stdin().as_raw_fd(); let termios = blocking::unblock(move || { nix::sys::termios::tcgetattr(stdin) - .map_err(crate::error::Error::SetRaw) + .map_err(crate::error::Error::SetTerminalMode) }) .await?; let mut termios_raw = termios.clone(); @@ -31,7 +31,7 @@ impl RawGuard { nix::sys::termios::SetArg::TCSANOW, &termios_raw, ) - .map_err(crate::error::Error::SetRaw) + .map_err(crate::error::Error::SetTerminalMode) }) .await?; Ok(Self { @@ -42,7 +42,7 @@ impl RawGuard { /// Switch back from raw mode early. /// /// # Errors - /// * `Error::UnsetRaw`: failed to return the terminal from raw mode + /// * `Error::SetTerminalMode`: failed to return the terminal from raw mode pub async fn cleanup(&mut self) -> crate::error::Result<()> { if let Some(termios) = self.termios.take() { let stdin = std::io::stdin().as_raw_fd(); @@ -52,7 +52,7 @@ impl RawGuard { nix::sys::termios::SetArg::TCSANOW, &termios, ) - .map_err(crate::error::Error::UnsetRaw) + .map_err(crate::error::Error::SetTerminalMode) }) .await } else { @@ -149,7 +149,7 @@ impl Input { /// instance. /// /// # Errors - /// * `Error::SetRaw`: failed to put the terminal into raw mode + /// * `Error::SetTerminalMode`: failed to put the terminal into raw mode pub async fn new() -> crate::error::Result<Self> { let mut self_ = Self::new_without_raw(); self_.raw = Some(RawGuard::new().await?); |