From d84b683dd961fb60ed2ab15ec8ed437502db95ef Mon Sep 17 00:00:00 2001 From: Bastian Gruber Date: Mon, 24 Apr 2023 23:49:24 +0200 Subject: [PATCH] Fix bytes --- problem_02/src/connection.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/problem_02/src/connection.rs b/problem_02/src/connection.rs index a4c65a7..cea6d1e 100644 --- a/problem_02/src/connection.rs +++ b/problem_02/src/connection.rs @@ -64,11 +64,11 @@ impl Connection { pub async fn write_frame(&mut self, frame: &Frame) -> tokio::io::Result<()> { debug!(?frame); if let Frame::Response(mean) = frame { - let res = self.stream.write(&mean.to_ne_bytes()).await?; + let res = self.stream.write(&[mean.to_ne_bytes()[0]]).await?; info!("Write frame Response to stream"); return self.stream.flush().await; } - Err("Wrong frame".into()) + Ok(()) } }