Skip to content

Commit af5ba99

Browse files
committed
📝 fix cargo clippy warnings
1 parent b3b67a3 commit af5ba99

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

src/io/sys/windows/miow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ impl AcceptAddrsBuf {
632632
///
633633
/// This function can be called after a call to `accept_overlapped` has
634634
/// succeeded to parse out the data that was written in.
635-
pub fn parse(&self, socket: &TcpListener) -> io::Result<AcceptAddrs> {
635+
pub fn parse(&self, socket: &TcpListener) -> io::Result<AcceptAddrs<'_>> {
636636
let mut ret = AcceptAddrs {
637637
local: std::ptr::null_mut(),
638638
local_len: 0,

src/net/tcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ impl TcpListener {
412412
a.done()
413413
}
414414

415-
pub fn incoming(&self) -> Incoming {
415+
pub fn incoming(&self) -> Incoming<'_> {
416416
Incoming { listener: self }
417417
}
418418

src/park.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl Park {
172172
Ok(())
173173
}
174174

175-
fn delay_drop(&self) -> DropGuard {
175+
fn delay_drop(&self) -> DropGuard<'_> {
176176
self.wait_kernel.store(true, Ordering::Release);
177177
DropGuard(self)
178178
}

src/sync/delay_drop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl DelayDrop {
1515
}
1616
}
1717

18-
pub fn delay_drop(&self) -> DropGuard {
18+
pub fn delay_drop(&self) -> DropGuard<'_> {
1919
self.can_drop.store(2, Ordering::Release);
2020
DropGuard(self)
2121
}

src/sync/mpmc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,11 @@ impl<T> Receiver<T> {
224224
self.inner.recv(Some(timeout))
225225
}
226226

227-
pub fn iter(&self) -> Iter<T> {
227+
pub fn iter(&self) -> Iter<'_, T> {
228228
Iter { rx: self }
229229
}
230230

231-
pub fn try_iter(&self) -> TryIter<T> {
231+
pub fn try_iter(&self) -> TryIter<'_, T> {
232232
TryIter { rx: self }
233233
}
234234
}

src/sync/mpsc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ impl<T> Receiver<T> {
228228
}
229229
}
230230

231-
pub fn iter(&self) -> Iter<T> {
231+
pub fn iter(&self) -> Iter<'_, T> {
232232
Iter { rx: self }
233233
}
234234

235-
pub fn try_iter(&self) -> TryIter<T> {
235+
pub fn try_iter(&self) -> TryIter<'_, T> {
236236
TryIter { rx: self }
237237
}
238238
}

src/sync/mutex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<T> Mutex<T> {
5151
}
5252

5353
impl<T: ?Sized> Mutex<T> {
54-
pub fn lock(&self) -> LockResult<MutexGuard<T>> {
54+
pub fn lock(&self) -> LockResult<MutexGuard<'_, T>> {
5555
// try lock first
5656
match self.try_lock() {
5757
Ok(g) => return Ok(g),
@@ -113,7 +113,7 @@ impl<T: ?Sized> Mutex<T> {
113113
MutexGuard::new(self)
114114
}
115115

116-
pub fn try_lock(&self) -> TryLockResult<MutexGuard<T>> {
116+
pub fn try_lock(&self) -> TryLockResult<MutexGuard<'_, T>> {
117117
match self
118118
.cnt
119119
.compare_exchange(0, 1, Ordering::SeqCst, Ordering::Relaxed)

src/sync/rwlock.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl<T: ?Sized> RwLock<T> {
142142
}
143143
}
144144

145-
pub fn read(&self) -> LockResult<RwLockReadGuard<T>> {
145+
pub fn read(&self) -> LockResult<RwLockReadGuard<'_, T>> {
146146
let mut r = self.rlock.lock().expect("rwlock read");
147147
if *r == 0 {
148148
if let Err(ParkError::Canceled) = self.lock() {
@@ -159,7 +159,7 @@ impl<T: ?Sized> RwLock<T> {
159159
RwLockReadGuard::new(self)
160160
}
161161

162-
pub fn try_read(&self) -> TryLockResult<RwLockReadGuard<T>> {
162+
pub fn try_read(&self) -> TryLockResult<RwLockReadGuard<'_, T>> {
163163
let mut r = match self.rlock.try_lock() {
164164
Ok(r) => r,
165165
Err(TryLockError::Poisoned(_)) => {
@@ -190,15 +190,15 @@ impl<T: ?Sized> RwLock<T> {
190190
}
191191
}
192192

193-
pub fn write(&self) -> LockResult<RwLockWriteGuard<T>> {
193+
pub fn write(&self) -> LockResult<RwLockWriteGuard<'_, T>> {
194194
if let Err(ParkError::Canceled) = self.lock() {
195195
// now we can safely go with the cancel panic
196196
trigger_cancel_panic();
197197
}
198198
RwLockWriteGuard::new(self)
199199
}
200200

201-
pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<T>> {
201+
pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<'_, T>> {
202202
if let Err(TryLockError::WouldBlock) = self.try_lock() {
203203
return Err(TryLockError::WouldBlock);
204204
}

src/sync/spsc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl<'a, T> Park<'a, T> {
2929
}
3030
}
3131

32-
fn delay_drop(&self) -> DropGuard<T> {
32+
fn delay_drop(&self) -> DropGuard<'_, '_, T> {
3333
DropGuard(self)
3434
}
3535
}
@@ -296,11 +296,11 @@ impl<T> Receiver<T> {
296296
}
297297
}
298298

299-
pub fn iter(&self) -> Iter<T> {
299+
pub fn iter(&self) -> Iter<'_, T> {
300300
Iter { rx: self }
301301
}
302302

303-
pub fn try_iter(&self) -> TryIter<T> {
303+
pub fn try_iter(&self) -> TryIter<'_, T> {
304304
TryIter { rx: self }
305305
}
306306
}

0 commit comments

Comments
 (0)