diff --git a/problem_02/src/connection.rs b/problem_02/src/connection.rs index 41f8e47..a4c65a7 100644 --- a/problem_02/src/connection.rs +++ b/problem_02/src/connection.rs @@ -61,13 +61,12 @@ impl Connection { } } - pub async fn write_frame(&mut self, frame: &Frame) -> crate::Result<()> { + pub async fn write_frame(&mut self, frame: &Frame) -> tokio::io::Result<()> { debug!(?frame); if let Frame::Response(mean) = frame { - let _ = self.stream.write(&[mean.to_ne_bytes()[0]]).await?; - let _ = self.stream.flush().await?; - info!("Wrote frame to stream"); - return Ok(()); + let res = self.stream.write(&mean.to_ne_bytes()).await?; + info!("Write frame Response to stream"); + return self.stream.flush().await; } Err("Wrong frame".into())