Skip to content

Commit 150ebea

Browse files
alexs-shThomasdezeeuw
authored andcommitted
clippy:fix needless_lifetime warnings
Running clippy with the enabled "net" feature reported several needless_lifetime warnings. This commit fixes them by switching to anonymous lifetimes. Versions: cargo 1.89.0 (c24e10642 2025-06-23) clippy 0.1.89 (29483883ee 2025-08-04) Command: cargo clippy --features net
1 parent cd97297 commit 150ebea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/net/tcp/stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl Read for TcpStream {
284284
}
285285
}
286286

287-
impl<'a> Read for &'a TcpStream {
287+
impl Read for &'_ TcpStream {
288288
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
289289
self.inner.do_io(|mut inner| inner.read(buf))
290290
}
@@ -308,7 +308,7 @@ impl Write for TcpStream {
308308
}
309309
}
310310

311-
impl<'a> Write for &'a TcpStream {
311+
impl Write for &'_ TcpStream {
312312
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
313313
self.inner.do_io(|mut inner| inner.write(buf))
314314
}

src/net/uds/stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl Read for UnixStream {
161161
}
162162
}
163163

164-
impl<'a> Read for &'a UnixStream {
164+
impl Read for &'_ UnixStream {
165165
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
166166
self.inner.do_io(|mut inner| inner.read(buf))
167167
}
@@ -185,7 +185,7 @@ impl Write for UnixStream {
185185
}
186186
}
187187

188-
impl<'a> Write for &'a UnixStream {
188+
impl Write for &'_ UnixStream {
189189
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
190190
self.inner.do_io(|mut inner| inner.write(buf))
191191
}

0 commit comments

Comments
 (0)