diff --git a/doc/src/zmqsource.rs b/doc/src/zmqsource.rs index cb57af79..65495d99 100644 --- a/doc/src/zmqsource.rs +++ b/doc/src/zmqsource.rs @@ -40,7 +40,6 @@ use anyhow::Context; /// messages over the same writeable ZeroMQ socket (usually PUB or PUSH). /// Messages should be sent over the Calloop MPSC channel sending end. This end /// can be cloned and used by multiple senders. - pub struct ZeroMQSource where T: IntoIterator, diff --git a/src/io.rs b/src/io.rs index 24f76410..6157c191 100644 --- a/src/io.rs +++ b/src/io.rs @@ -51,7 +51,7 @@ pub struct Async<'l, F: AsFd> { was_nonblocking: bool, } -impl<'l, F: AsFd + std::fmt::Debug> std::fmt::Debug for Async<'l, F> { +impl std::fmt::Debug for Async<'_, F> { #[cfg_attr(feature = "nightly_coverage", coverage(off))] fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("Async").field("fd", &self.fd).finish() @@ -146,7 +146,7 @@ pub struct Readable<'s, 'l, F: AsFd> { io: &'s mut Async<'l, F>, } -impl<'s, 'l, F: AsFd> std::future::Future for Readable<'s, 'l, F> { +impl std::future::Future for Readable<'_, '_, F> { type Output = (); fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> TaskPoll<()> { let io = &mut self.as_mut().io; @@ -166,7 +166,7 @@ pub struct Writable<'s, 'l, F: AsFd> { io: &'s mut Async<'l, F>, } -impl<'s, 'l, F: AsFd> std::future::Future for Writable<'s, 'l, F> { +impl std::future::Future for Writable<'_, '_, F> { type Output = (); fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> TaskPoll<()> { let io = &mut self.as_mut().io; @@ -180,7 +180,7 @@ impl<'s, 'l, F: AsFd> std::future::Future for Writable<'s, 'l, F> { } } -impl<'l, F: AsFd> Drop for Async<'l, F> { +impl Drop for Async<'_, F> { fn drop(&mut self) { self.inner.kill(&self.dispatcher); // restore flags @@ -191,7 +191,7 @@ impl<'l, F: AsFd> Drop for Async<'l, F> { } } -impl<'l, F: AsFd> Unpin for Async<'l, F> {} +impl Unpin for Async<'_, F> {} trait IoLoopInner { unsafe fn register(&self, dispatcher: &RefCell) -> crate::Result<()>; @@ -199,7 +199,7 @@ trait IoLoopInner { fn kill(&self, dispatcher: &RefCell); } -impl<'l, Data> IoLoopInner for LoopInner<'l, Data> { +impl IoLoopInner for LoopInner<'_, Data> { unsafe fn register(&self, dispatcher: &RefCell) -> crate::Result<()> { let disp = dispatcher.borrow(); self.poll.borrow_mut().register( @@ -306,7 +306,7 @@ impl EventDispatcher for RefCell { #[cfg(feature = "futures-io")] #[cfg_attr(docsrs, doc(cfg(feature = "futures-io")))] -impl<'l, F: AsFd + std::io::Read> AsyncRead for Async<'l, F> { +impl AsyncRead for Async<'_, F> { fn poll_read( mut self: Pin<&mut Self>, cx: &mut Context<'_>, @@ -336,7 +336,7 @@ impl<'l, F: AsFd + std::io::Read> AsyncRead for Async<'l, F> { #[cfg(feature = "futures-io")] #[cfg_attr(docsrs, doc(cfg(feature = "futures-io")))] -impl<'l, F: AsFd + std::io::Write> AsyncWrite for Async<'l, F> { +impl AsyncWrite for Async<'_, F> { fn poll_write( mut self: Pin<&mut Self>, cx: &mut Context<'_>, diff --git a/src/loop_logic.rs b/src/loop_logic.rs index a1c5ebaa..cc889ff8 100644 --- a/src/loop_logic.rs +++ b/src/loop_logic.rs @@ -66,14 +66,14 @@ pub struct LoopHandle<'l, Data> { inner: Rc>, } -impl<'l, Data> std::fmt::Debug for LoopHandle<'l, Data> { +impl std::fmt::Debug for LoopHandle<'_, Data> { #[cfg_attr(feature = "nightly_coverage", coverage(off))] fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str("LoopHandle { ... }") } } -impl<'l, Data> Clone for LoopHandle<'l, Data> { +impl Clone for LoopHandle<'_, Data> { #[cfg_attr(feature = "nightly_coverage", coverage(off))] fn clone(&self) -> Self { LoopHandle { @@ -302,7 +302,7 @@ pub struct EventLoop<'l, Data> { synthetic_events: Vec, } -impl<'l, Data> std::fmt::Debug for EventLoop<'l, Data> { +impl std::fmt::Debug for EventLoop<'_, Data> { #[cfg_attr(feature = "nightly_coverage", coverage(off))] fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str("EventLoop { ... }") @@ -661,7 +661,7 @@ impl<'l, Data> EventLoop<'l, Data> { } #[cfg(unix)] -impl<'l, Data> AsRawFd for EventLoop<'l, Data> { +impl AsRawFd for EventLoop<'_, Data> { /// Get the underlying raw-fd of the poller. /// /// This could be used to create [`Generic`] source out of the current loop @@ -675,7 +675,7 @@ impl<'l, Data> AsRawFd for EventLoop<'l, Data> { } #[cfg(unix)] -impl<'l, Data> AsFd for EventLoop<'l, Data> { +impl AsFd for EventLoop<'_, Data> { /// Get the underlying fd of the poller. /// /// This could be used to create [`Generic`] source out of the current loop @@ -714,7 +714,7 @@ pub struct EventIterator<'a> { registration_token: RegistrationToken, } -impl<'a> Iterator for EventIterator<'a> { +impl Iterator for EventIterator<'_> { type Item = (Readiness, Token); fn next(&mut self) -> Option { diff --git a/src/sources/mod.rs b/src/sources/mod.rs index 58f59b73..489d8084 100644 --- a/src/sources/mod.rs +++ b/src/sources/mod.rs @@ -483,7 +483,7 @@ where /// Use `into_source_inner` to get the event source back. pub struct Dispatcher<'a, S, Data>(Rc + 'a>); -impl<'a, S, Data> std::fmt::Debug for Dispatcher<'a, S, Data> { +impl std::fmt::Debug for Dispatcher<'_, S, Data> { #[cfg_attr(feature = "nightly_coverage", coverage(off))] fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str("Dispatcher { ... }") @@ -560,14 +560,14 @@ pub struct Idle<'i> { pub(crate) callback: Rc>, } -impl<'i> std::fmt::Debug for Idle<'i> { +impl std::fmt::Debug for Idle<'_> { #[cfg_attr(feature = "nightly_coverage", coverage(off))] fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str("Idle { ... }") } } -impl<'i> Idle<'i> { +impl Idle<'_> { /// Cancel the idle callback if it was not already run pub fn cancel(self) { self.callback.borrow_mut().cancel(); diff --git a/src/sources/transient.rs b/src/sources/transient.rs index 72d3154f..107af756 100644 --- a/src/sources/transient.rs +++ b/src/sources/transient.rs @@ -387,13 +387,13 @@ mod tests { ping: PingSource, } - impl<'a> Drop for TestSource<'a> { + impl Drop for TestSource<'_> { fn drop(&mut self) { self.dropped.store(true, Ordering::Relaxed) } } - impl<'a> crate::EventSource for TestSource<'a> { + impl crate::EventSource for TestSource<'_> { type Event = (); type Metadata = (); type Ret = ();