diff --git a/fake-tcp/src/lib.rs b/fake-tcp/src/lib.rs
index a431651..6a81880 100644
--- a/fake-tcp/src/lib.rs
+++ b/fake-tcp/src/lib.rs
@@ -403,7 +403,7 @@ impl Stack {
     /// the connection attempt failed.
     pub async fn connect(&mut self, addr: SocketAddr) -> Option<Socket> {
         let mut rng = SmallRng::from_os_rng();
-        for local_port in rng.gen_range(32768..=60999)..=60999 {
+        for local_port in rng.random_range(32768..=60999)..=60999 {
             let local_addr = SocketAddr::new(
                 if addr.is_ipv4() {
                     IpAddr::V4(self.local_ip)
diff --git a/fake-tcp/src/packet.rs b/fake-tcp/src/packet.rs
index 349ffb7..fb8ad13 100644
--- a/fake-tcp/src/packet.rs
+++ b/fake-tcp/src/packet.rs
@@ -15,7 +15,7 @@ pub enum IPPacket<'p> {
     V6(ipv6::Ipv6Packet<'p>),
 }
 
-impl<'a> IPPacket<'a> {
+impl IPPacket<'_> {
     pub fn get_source(&self) -> IpAddr {
         match self {
             IPPacket::V4(p) => IpAddr::V4(p.get_source()),