]> git.lizzy.rs Git - mt_rudp.git/blobdiff - src/send.rs
write_all
[mt_rudp.git] / src / send.rs
index 3ec3c64f1f4e248e5e285e9f689677930f483876..741c54211eadda9ba23449768f4cc36a689edd20 100644 (file)
@@ -12,7 +12,6 @@ impl<S: UdpSender> RudpSender<S> {
 }
 
 impl<S: UdpSender> RudpShare<S> {
-    #[allow(clippy::unused_io_amount)]
     pub async fn send(&self, tp: PktType, pkt: Pkt<&[u8]>) -> AckResult {
         let mut buf = Vec::with_capacity(4 + 2 + 1 + 1 + 2 + 1 + pkt.data.len());
         buf.write_u32::<BigEndian>(PROTO_ID)?;
@@ -28,7 +27,7 @@ impl<S: UdpSender> RudpShare<S> {
         }
 
         buf.write_u8(tp as u8)?;
-        buf.write(pkt.data)?;
+        buf.write_all(pkt.data)?;
 
         self.send_raw(&buf).await?;