refactor: result return
This commit is contained in:
+3
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user