From 7857741f98aa990569ea24d1f4165adbb092437c Mon Sep 17 00:00:00 2001 From: peg Date: Thu, 19 Dec 2024 08:03:05 +0100 Subject: [PATCH] Updates for latest version of tungstenite --- crates/protocol/src/protocol_transport/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/protocol/src/protocol_transport/mod.rs b/crates/protocol/src/protocol_transport/mod.rs index 4fff145dd..8b86d5663 100644 --- a/crates/protocol/src/protocol_transport/mod.rs +++ b/crates/protocol/src/protocol_transport/mod.rs @@ -106,14 +106,14 @@ impl WsConnection for tokio_tungstenite::WebSocketStream) -> Result<(), WsError> { - SinkExt::send(&mut self, tungstenite::Message::Binary(msg)) + SinkExt::send(&mut self, tungstenite::Message::Binary(msg.into())) .await .map_err(|_| WsError::ConnectionClosed) } @@ -130,14 +130,14 @@ impl WsConnection for tokio_tungstenite::WebSocketStream .ok_or(WsError::ConnectionClosed)? .map_err(|e| WsError::ConnectionError(e.to_string()))? { - Ok(msg) + Ok(msg.to_vec()) } else { Err(WsError::UnexpectedMessageType) } } async fn send(&mut self, msg: Vec) -> Result<(), WsError> { - SinkExt::send(&mut self, tungstenite::Message::Binary(msg)) + SinkExt::send(&mut self, tungstenite::Message::Binary(msg.into())) .await .map_err(|_| WsError::ConnectionClosed) }