diff --git a/hptp/src/peer.rs b/hptp/src/peer.rs index a001d9e..082d16b 100644 --- a/hptp/src/peer.rs +++ b/hptp/src/peer.rs @@ -20,11 +20,7 @@ impl Peer { pub async fn send(&mut self, msg: Msg) -> Result<(), tokio::io::Error> { let targ = self.targ.expect("no target to send to"); let bs = msg.ser(); - let mut i = 0; - while i < bs.len() { - let n = self.sock.send_to(&bs[i..], targ).await?; - i += n - } + let _n_sent = self.sock.send_to(&bs, targ).await?; Ok(()) }