From d9f0bd5566e27218b8c8eaba6ece237907771c1d Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Sat, 11 Mar 2023 21:04:16 +0000 Subject: [PATCH] refactor: result return --- src/ui/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 232c059..5f9ee65 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -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 @@ -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