Skip to content

Commit

Permalink
refactor: result return
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Mar 11, 2023
1 parent 5ff5452 commit d9f0bd5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ pub struct Ui {
impl Ui {
/// Enable mouse capture, but don't enable capture of all the mouse movements, doing so will improve performance, and is part of the fix for the weird mouse event output bug
pub fn enable_mouse_capture() -> Result<()> {
io::stdout().write_all(
Ok(io::stdout().write_all(
concat!(
crossterm::csi!("?1000h"),
crossterm::csi!("?1015h"),
crossterm::csi!("?1006h"),
)
.as_bytes(),
)?;
Ok(())
)?)
}

/// Create a new Ui struct, and execute the drawing loop
Expand Down Expand Up @@ -112,8 +111,7 @@ impl Ui {
DisableMouseCapture
)?;
disable_raw_mode()?;
self.terminal.show_cursor()?;
Ok(())
Ok(self.terminal.show_cursor()?)
}

/// Draw the the error message ui, for 5 seconds, with a countdown
Expand Down

0 comments on commit d9f0bd5

Please sign in to comment.