diff options
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | src/app.rs | 8 | ||||
-rw-r--r-- | src/io.rs | 6 |
3 files changed, 11 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 86bbdb4..bf6ed05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### master +- fix some cases of terminal let in a bad state on errors + <a name="v0.11.9"></a> ### v0.11.9 - 2020-01-15 - fix a case of bad selection after search followed by interrupted search (#147) @@ -37,7 +37,10 @@ use { /// Helper function for type inference: queue a Command but return Result<()> #[inline] -fn just_queue(mut writer: impl Write, command: impl crossterm::Command) -> crossterm::Result<()> { +fn just_queue( + mut writer: impl Write, + command: impl crossterm::Command, +) -> crossterm::Result<()> { writer.queue(command).map(move |_| ()) } @@ -168,7 +171,7 @@ impl App { // Ensure the buffer is flushed before we return let writer = WriteCleanup::new(writer, |w| w.flush()); - // Push some terminal state changes, ensuring the're reverted when we + // Push some terminal state changes, ensuring they're reverted when we // end the program. let writer = WriteCleanup::build( writer, @@ -191,7 +194,6 @@ impl App { |w| just_queue(w, EnableMouseCapture), |w| just_queue(w, DisableMouseCapture), )?; - let event_source = EventSource::new()?; let rx_events = event_source.receiver(); @@ -66,7 +66,7 @@ where F: Fn(&mut W) -> Result<(), E>, E: fmt::Display, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("WriteCleanup") .field("writer", &self.writer) .field("cleanup", &"<closure>") @@ -91,7 +91,7 @@ where } #[inline] - fn write_vectored(&mut self, bufs: &[io::IoSlice]) -> io::Result<usize> { + fn write_vectored(&mut self, bufs: &[io::IoSlice<'_>]) -> io::Result<usize> { self.writer.write_vectored(bufs) } @@ -101,7 +101,7 @@ where } #[inline] - fn write_fmt(&mut self, fmt: fmt::Arguments) -> io::Result<()> { + fn write_fmt(&mut self, fmt: fmt::Arguments<'_>) -> io::Result<()> { self.writer.write_fmt(fmt) } } |