From 60d42b1aaa26084147d55fb1498f82cffd4e7c15 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 5 Jul 2020 17:13:14 +0800 Subject: [PATCH] remove duplicated write_chunk function --- src/runtime/src/comms.rs | 6 ------ src/runtime/src/proto_async.rs | 1 - 2 files changed, 7 deletions(-) diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index ca963ef..86fac79 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -78,12 +78,6 @@ enum Reply { ClockFailure = 15, } -async fn write_chunk(stream: &TcpStream, chunk: &[u8]) -> Result<()> { - write_i32(stream, chunk.len() as i32).await?; - stream.send(chunk.iter().copied()).await?; - Ok(()) -} - async fn write_header(stream: &TcpStream, reply: Reply) -> Result<()> { stream.send([0x5a, 0x5a, 0x5a, 0x5a, reply.to_u8().unwrap()].iter().copied()).await?; Ok(()) diff --git a/src/runtime/src/proto_async.rs b/src/runtime/src/proto_async.rs index 5188fc3..366eb78 100644 --- a/src/runtime/src/proto_async.rs +++ b/src/runtime/src/proto_async.rs @@ -123,4 +123,3 @@ pub async fn write_chunk(stream: &TcpStream, value: &[u8]) -> Result<()> { stream.send(value.iter().copied()).await?; Ok(()) } -