From 3821fd4224c066c40fc492c8b049bd47c9a212fa Mon Sep 17 00:00:00 2001 From: Picnoir Date: Wed, 3 Apr 2024 11:31:19 +0200 Subject: chore(users/picnoir/tvix-daemon): apply clippy suggestions Remove potential partial reads/writes and instead read/write the full buffer size: we want those to be 64 bits. Change-Id: I1f767baf23fa80c2babb8113f61d1a9e72a8d8dd Reviewed-on: https://cl.tvl.fyi/c/depot/+/11350 Reviewed-by: flokli Tested-by: BuildkiteCI --- users/picnoir/tvix-daemon/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'users') diff --git a/users/picnoir/tvix-daemon/src/main.rs b/users/picnoir/tvix-daemon/src/main.rs index 7b1b735baa..807b4791fe 100644 --- a/users/picnoir/tvix-daemon/src/main.rs +++ b/users/picnoir/tvix-daemon/src/main.rs @@ -86,7 +86,7 @@ where &'a mut R: AsyncReadExt + AsyncWriteExt + Unpin + std::fmt::Debug, { let mut magic_hello = vec![0; 8]; - conn.read(&mut magic_hello).await?; + conn.read_exact(&mut magic_hello).await?; debug!("Hello read"); if magic_hello != primitive::MAGIC_HELLO { Err(anyhow!( @@ -95,8 +95,8 @@ where primitive::MAGIC_HELLO )) } else { - conn.write(&primitive::MAGIC_HELLO_RESPONSE).await?; - conn.write(&primitive::PROTOCOL_VERSION).await?; + conn.write_all(&primitive::MAGIC_HELLO_RESPONSE).await?; + conn.write_all(&primitive::PROTOCOL_VERSION).await?; conn.flush().await?; debug!("Hello responded"); let client_version = primitive::read_u64(&mut conn).await?; -- cgit 1.4.1