Skip to content

Commit

Permalink
Remove needless lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Dec 26, 2024
1 parent c4c5414 commit f0d4689
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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::<IpAddr>() {
Expand Down
4 changes: 2 additions & 2 deletions src/top.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit f0d4689

Please sign in to comment.