From: Lizzy Fleckenstein Date: Sat, 7 Jan 2023 00:18:34 +0000 (+0100) Subject: write_all X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=701f249245ecbd813e7da924fb9eafab5a7cfd0b;p=mt_rudp.git write_all --- diff --git a/examples/example.rs b/examples/example.rs index 0a6dc42..fc5f1fb 100644 --- a/examples/example.rs +++ b/examples/example.rs @@ -12,7 +12,7 @@ async fn example(tx: &RudpSender, rx: &mut RudpReceiver) -> io:: pkt.write_u16::(40)?; // MinProtoVer pkt.write_u16::(40)?; // MaxProtoVer pkt.write_u16::(3)?; // player name length - pkt.write(b"foo")?; // player name + pkt.write_all(b"foo")?; // player name tx.send(mt_rudp::Pkt { unrel: true, diff --git a/src/send.rs b/src/send.rs index 3ec3c64..741c542 100644 --- a/src/send.rs +++ b/src/send.rs @@ -12,7 +12,6 @@ impl RudpSender { } impl RudpShare { - #[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::(PROTO_ID)?; @@ -28,7 +27,7 @@ impl RudpShare { } buf.write_u8(tp as u8)?; - buf.write(pkt.data)?; + buf.write_all(pkt.data)?; self.send_raw(&buf).await?;