diff --git a/src/event.rs b/src/event.rs index e0a8b4e..da93dbf 100644 --- a/src/event.rs +++ b/src/event.rs @@ -1,6 +1,5 @@ use std::iter; use std::sync::mpsc; -use std::sync::mpsc::TryIter; use std::thread; use std::time::{Duration, Instant}; @@ -45,20 +44,15 @@ impl Events { }) }; Events { - tx: tx, - rx: rx, + tx, + rx, tick_handle, } } /// 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. - pub fn blocking_iter( - &self, - ) -> Result>, TryIter>>, mpsc::RecvError> - { - Ok(iter::once(self.rx.recv()?) - .chain(self.rx.try_iter()) - .into_iter()) + pub fn blocking_iter(&self) -> Result> + '_, mpsc::RecvError> { + Ok(iter::once(self.rx.recv()?).chain(self.rx.try_iter())) } }