remove duplicated write_chunk function

This commit is contained in:
Sebastien Bourdeauducq 2020-07-05 17:13:14 +08:00
parent 707b82316b
commit 60d42b1aaa
2 changed files with 0 additions and 7 deletions

View File

@ -78,12 +78,6 @@ enum Reply {
ClockFailure = 15, 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<()> { async fn write_header(stream: &TcpStream, reply: Reply) -> Result<()> {
stream.send([0x5a, 0x5a, 0x5a, 0x5a, reply.to_u8().unwrap()].iter().copied()).await?; stream.send([0x5a, 0x5a, 0x5a, 0x5a, reply.to_u8().unwrap()].iter().copied()).await?;
Ok(()) Ok(())

View File

@ -123,4 +123,3 @@ pub async fn write_chunk(stream: &TcpStream, value: &[u8]) -> Result<()> {
stream.send(value.iter().copied()).await?; stream.send(value.iter().copied()).await?;
Ok(()) Ok(())
} }