From f0d468977a8809e519424d9d85c86282ddc03520 Mon Sep 17 00:00:00 2001 From: tottoto Date: Fri, 27 Dec 2024 07:39:14 +0900 Subject: [PATCH] Remove needless lifetime --- src/dns.rs | 4 ++-- src/top.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dns.rs b/src/dns.rs index 352a1e3..39cf31d 100644 --- a/src/dns.rs +++ b/src/dns.rs @@ -63,7 +63,7 @@ impl ToIpAddr for String { } } -impl<'a> ToIpAddr for &'a str { +impl ToIpAddr for &str { fn to_ip_addr(&self, dns: &mut Dns) -> IpAddr { if let Ok(ipaddr) = self.parse() { return ipaddr; @@ -121,7 +121,7 @@ impl ToSocketAddrs for (String, u16) { } } -impl<'a> ToSocketAddrs for (&'a str, u16) { +impl ToSocketAddrs for (&str, u16) { fn to_socket_addr(&self, dns: &Dns) -> SocketAddr { // When IP address is passed directly as a str. if let Ok(ip) = self.0.parse::() { diff --git a/src/top.rs b/src/top.rs index fd7a955..40dbb02 100644 --- a/src/top.rs +++ b/src/top.rs @@ -58,7 +58,7 @@ pub struct LinkIter<'a> { iter: std::collections::vec_deque::IterMut<'a, Sent>, } -impl<'a> LinkIter<'a> { +impl LinkIter<'_> { /// The [`IpAddr`] pair for the link. Always ordered to uniquely identify /// the link. pub fn pair(&self) -> (IpAddr, IpAddr) { @@ -83,7 +83,7 @@ pub struct SentRef<'a> { sent: &'a mut Sent, } -impl<'a> SentRef<'a> { +impl SentRef<'_> { /// The (src, dst) [`SocketAddr`] pair for the message. pub fn pair(&self) -> (SocketAddr, SocketAddr) { (self.src, self.dst)