Skip to content

Commit 4bd9182

Browse files
committed
m: Elide lifetimes that can be implicit
Pleases clippy. Signed-off-by: John Nunley <dev@notgull.net>
1 parent 2a13145 commit 4bd9182

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

doc/src/zmqsource.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use anyhow::Context;
4040
/// messages over the same writeable ZeroMQ socket (usually PUB or PUSH).
4141
/// Messages should be sent over the Calloop MPSC channel sending end. This end
4242
/// can be cloned and used by multiple senders.
43-
4443
pub struct ZeroMQSource<T>
4544
where
4645
T: IntoIterator,

src/io.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub struct Async<'l, F: AsFd> {
5151
was_nonblocking: bool,
5252
}
5353

54-
impl<'l, F: AsFd + std::fmt::Debug> std::fmt::Debug for Async<'l, F> {
54+
impl<F: AsFd + std::fmt::Debug> std::fmt::Debug for Async<'_, F> {
5555
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
5656
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5757
f.debug_struct("Async").field("fd", &self.fd).finish()
@@ -146,7 +146,7 @@ pub struct Readable<'s, 'l, F: AsFd> {
146146
io: &'s mut Async<'l, F>,
147147
}
148148

149-
impl<'s, 'l, F: AsFd> std::future::Future for Readable<'s, 'l, F> {
149+
impl<F: AsFd> std::future::Future for Readable<'_, '_, F> {
150150
type Output = ();
151151
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> TaskPoll<()> {
152152
let io = &mut self.as_mut().io;
@@ -166,7 +166,7 @@ pub struct Writable<'s, 'l, F: AsFd> {
166166
io: &'s mut Async<'l, F>,
167167
}
168168

169-
impl<'s, 'l, F: AsFd> std::future::Future for Writable<'s, 'l, F> {
169+
impl<F: AsFd> std::future::Future for Writable<'_, '_, F> {
170170
type Output = ();
171171
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> TaskPoll<()> {
172172
let io = &mut self.as_mut().io;
@@ -180,7 +180,7 @@ impl<'s, 'l, F: AsFd> std::future::Future for Writable<'s, 'l, F> {
180180
}
181181
}
182182

183-
impl<'l, F: AsFd> Drop for Async<'l, F> {
183+
impl<F: AsFd> Drop for Async<'_, F> {
184184
fn drop(&mut self) {
185185
self.inner.kill(&self.dispatcher);
186186
// restore flags
@@ -191,15 +191,15 @@ impl<'l, F: AsFd> Drop for Async<'l, F> {
191191
}
192192
}
193193

194-
impl<'l, F: AsFd> Unpin for Async<'l, F> {}
194+
impl<F: AsFd> Unpin for Async<'_, F> {}
195195

196196
trait IoLoopInner {
197197
unsafe fn register(&self, dispatcher: &RefCell<IoDispatcher>) -> crate::Result<()>;
198198
fn reregister(&self, dispatcher: &RefCell<IoDispatcher>) -> crate::Result<()>;
199199
fn kill(&self, dispatcher: &RefCell<IoDispatcher>);
200200
}
201201

202-
impl<'l, Data> IoLoopInner for LoopInner<'l, Data> {
202+
impl<Data> IoLoopInner for LoopInner<'_, Data> {
203203
unsafe fn register(&self, dispatcher: &RefCell<IoDispatcher>) -> crate::Result<()> {
204204
let disp = dispatcher.borrow();
205205
self.poll.borrow_mut().register(
@@ -306,7 +306,7 @@ impl<Data> EventDispatcher<Data> for RefCell<IoDispatcher> {
306306

307307
#[cfg(feature = "futures-io")]
308308
#[cfg_attr(docsrs, doc(cfg(feature = "futures-io")))]
309-
impl<'l, F: AsFd + std::io::Read> AsyncRead for Async<'l, F> {
309+
impl<F: AsFd + std::io::Read> AsyncRead for Async<'_, F> {
310310
fn poll_read(
311311
mut self: Pin<&mut Self>,
312312
cx: &mut Context<'_>,
@@ -336,7 +336,7 @@ impl<'l, F: AsFd + std::io::Read> AsyncRead for Async<'l, F> {
336336

337337
#[cfg(feature = "futures-io")]
338338
#[cfg_attr(docsrs, doc(cfg(feature = "futures-io")))]
339-
impl<'l, F: AsFd + std::io::Write> AsyncWrite for Async<'l, F> {
339+
impl<F: AsFd + std::io::Write> AsyncWrite for Async<'_, F> {
340340
fn poll_write(
341341
mut self: Pin<&mut Self>,
342342
cx: &mut Context<'_>,

src/loop_logic.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ pub struct LoopHandle<'l, Data> {
6666
inner: Rc<LoopInner<'l, Data>>,
6767
}
6868

69-
impl<'l, Data> std::fmt::Debug for LoopHandle<'l, Data> {
69+
impl<Data> std::fmt::Debug for LoopHandle<'_, Data> {
7070
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
7171
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7272
f.write_str("LoopHandle { ... }")
7373
}
7474
}
7575

76-
impl<'l, Data> Clone for LoopHandle<'l, Data> {
76+
impl<Data> Clone for LoopHandle<'_, Data> {
7777
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
7878
fn clone(&self) -> Self {
7979
LoopHandle {
@@ -302,7 +302,7 @@ pub struct EventLoop<'l, Data> {
302302
synthetic_events: Vec<PollEvent>,
303303
}
304304

305-
impl<'l, Data> std::fmt::Debug for EventLoop<'l, Data> {
305+
impl<Data> std::fmt::Debug for EventLoop<'_, Data> {
306306
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
307307
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
308308
f.write_str("EventLoop { ... }")
@@ -661,7 +661,7 @@ impl<'l, Data> EventLoop<'l, Data> {
661661
}
662662

663663
#[cfg(unix)]
664-
impl<'l, Data> AsRawFd for EventLoop<'l, Data> {
664+
impl<Data> AsRawFd for EventLoop<'_, Data> {
665665
/// Get the underlying raw-fd of the poller.
666666
///
667667
/// 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> {
675675
}
676676

677677
#[cfg(unix)]
678-
impl<'l, Data> AsFd for EventLoop<'l, Data> {
678+
impl<Data> AsFd for EventLoop<'_, Data> {
679679
/// Get the underlying fd of the poller.
680680
///
681681
/// This could be used to create [`Generic`] source out of the current loop
@@ -714,7 +714,7 @@ pub struct EventIterator<'a> {
714714
registration_token: RegistrationToken,
715715
}
716716

717-
impl<'a> Iterator for EventIterator<'a> {
717+
impl Iterator for EventIterator<'_> {
718718
type Item = (Readiness, Token);
719719

720720
fn next(&mut self) -> Option<Self::Item> {

src/sources/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ where
483483
/// Use `into_source_inner` to get the event source back.
484484
pub struct Dispatcher<'a, S, Data>(Rc<dyn ErasedDispatcher<'a, S, Data> + 'a>);
485485

486-
impl<'a, S, Data> std::fmt::Debug for Dispatcher<'a, S, Data> {
486+
impl<S, Data> std::fmt::Debug for Dispatcher<'_, S, Data> {
487487
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
488488
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
489489
f.write_str("Dispatcher { ... }")
@@ -560,14 +560,14 @@ pub struct Idle<'i> {
560560
pub(crate) callback: Rc<RefCell<dyn CancellableIdle + 'i>>,
561561
}
562562

563-
impl<'i> std::fmt::Debug for Idle<'i> {
563+
impl std::fmt::Debug for Idle<'_> {
564564
#[cfg_attr(feature = "nightly_coverage", coverage(off))]
565565
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
566566
f.write_str("Idle { ... }")
567567
}
568568
}
569569

570-
impl<'i> Idle<'i> {
570+
impl Idle<'_> {
571571
/// Cancel the idle callback if it was not already run
572572
pub fn cancel(self) {
573573
self.callback.borrow_mut().cancel();

src/sources/transient.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,13 @@ mod tests {
387387
ping: PingSource,
388388
}
389389

390-
impl<'a> Drop for TestSource<'a> {
390+
impl Drop for TestSource<'_> {
391391
fn drop(&mut self) {
392392
self.dropped.store(true, Ordering::Relaxed)
393393
}
394394
}
395395

396-
impl<'a> crate::EventSource for TestSource<'a> {
396+
impl crate::EventSource for TestSource<'_> {
397397
type Event = ();
398398
type Metadata = ();
399399
type Ret = ();

0 commit comments

Comments
 (0)