From 3c7cd6f0ecbe02c04f6eb66fa416a0a9b602b514 Mon Sep 17 00:00:00 2001 From: EAimTY Date: Wed, 5 Apr 2023 18:32:43 +0900 Subject: [PATCH] fix lifetime notation for `Fragments` --- tuic/src/model/packet.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tuic/src/model/packet.rs b/tuic/src/model/packet.rs index b41d523..097e45b 100644 --- a/tuic/src/model/packet.rs +++ b/tuic/src/model/packet.rs @@ -39,7 +39,7 @@ impl Packet { /// Fragment the payload into multiple packets pub fn into_fragments<'a, P>(self, payload: P) -> Fragments<'a, P> where - P: AsRef<[u8]>, + P: AsRef<[u8]> + 'a, { let Side::Tx(tx) = self.inner else { unreachable!() }; Fragments::new(tx.assoc_id, tx.pkt_id, tx.addr, tx.max_pkt_size, payload) @@ -182,10 +182,7 @@ impl Debug for Packet { /// Iterator over fragments of a packet #[derive(Debug)] -pub struct Fragments<'a, P> -where - P: 'a, -{ +pub struct Fragments<'a, P> { assoc_id: u16, pkt_id: u16, addr: Address,