diff options
Diffstat (limited to 'src/send.rs')
-rw-r--r-- | src/send.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/send.rs b/src/send.rs index e0c2fa3..a3a7f03 100644 --- a/src/send.rs +++ b/src/send.rs @@ -6,13 +6,13 @@ use tokio::sync::watch; pub type AckResult = io::Result<Option<watch::Receiver<bool>>>; impl<S: UdpSender> RudpSender<S> { - pub async fn send(&self, pkt: Pkt<&[u8]>) -> AckResult { + pub async fn send(&self, pkt: Pkt<'_>) -> AckResult { self.share.send(PktType::Orig, pkt).await // TODO: splits } } impl<S: UdpSender> RudpShare<S> { - pub async fn send(&self, tp: PktType, pkt: Pkt<&[u8]>) -> AckResult { + pub async fn send(&self, tp: PktType, pkt: Pkt<'_>) -> AckResult { let mut buf = Vec::with_capacity(4 + 2 + 1 + 1 + 2 + 1 + pkt.data.len()); buf.write_u32::<BigEndian>(PROTO_ID)?; buf.write_u16::<BigEndian>(*self.remote_id.read().await)?; @@ -27,7 +27,7 @@ impl<S: UdpSender> RudpShare<S> { } buf.write_u8(tp as u8)?; - buf.write_all(pkt.data)?; + buf.write_all(pkt.data.as_ref())?; self.send_raw(&buf).await?; |