Autoformat

This commit is contained in:
Austen Adler 2021-05-18 19:56:27 -04:00
parent 8fa4b08314
commit f2f4f0b6f4

View File

@ -52,7 +52,9 @@ impl Events {
/// Returns a chain of the next element (blocking) and a TryIter of everything after it. /// Returns a chain of the next element (blocking) and a TryIter of everything after it.
/// Useful for reading a single Iterator of all elements once after blocking, so there are not too many UI redraws. /// Useful for reading a single Iterator of all elements once after blocking, so there are not too many UI redraws.
pub fn blocking_iter(&self) -> Result<impl Iterator<Item = Event<KeyEvent>> + '_, mpsc::RecvError> { pub fn blocking_iter(
&self,
) -> Result<impl Iterator<Item = Event<KeyEvent>> + '_, mpsc::RecvError> {
Ok(iter::once(self.rx.recv()?).chain(self.rx.try_iter())) Ok(iter::once(self.rx.recv()?).chain(self.rx.try_iter()))
} }
} }