diff --git a/CHANGELOG.md b/CHANGELOG.md index fe41cbb..a838b23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.26.0 + +- Update `tungstenite` to `0.26.0` ([breaking changes](https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md#0260)). + # 0.25.0 - Update `tungstenite` to `0.25.0` ([important updates!](https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md#0250)). diff --git a/Cargo.toml b/Cargo.toml index db17e96..35c60bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,9 +6,9 @@ keywords = ["websocket", "io", "web"] authors = ["Daniel Abramov ", "Alexey Galakhov "] license = "MIT" homepage = "https://github.com/snapview/tokio-tungstenite" -documentation = "https://docs.rs/tokio-tungstenite/0.25.0" +documentation = "https://docs.rs/tokio-tungstenite/0.26.0" repository = "https://github.com/snapview/tokio-tungstenite" -version = "0.25.0" +version = "0.26.0" edition = "2018" rust-version = "1.63" include = ["examples/**/*", "src/**/*", "LICENSE", "README.md", "CHANGELOG.md"] @@ -34,7 +34,7 @@ futures-util = { version = "0.3.28", default-features = false, features = ["sink tokio = { version = "1.0.0", default-features = false, features = ["io-util"] } [dependencies.tungstenite] -version = "0.25.0" +version = "0.26.0" default-features = false [dependencies.native-tls-crate] diff --git a/examples/client.rs b/examples/client.rs index a4a6437..05a7375 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -33,7 +33,7 @@ async fn main() { let ws_to_stdout = { read.for_each(|message| async { let data = message.unwrap().into_data(); - tokio::io::stdout().write_all(&data.as_slice()).await.unwrap(); + tokio::io::stdout().write_all(&data).await.unwrap(); }) }; diff --git a/src/lib.rs b/src/lib.rs index 734fc64..679640a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -269,11 +269,10 @@ impl WebSocketStream { } /// Close the underlying web socket - pub async fn close(&mut self, msg: Option>) -> Result<(), WsError> + pub async fn close(&mut self, msg: Option) -> Result<(), WsError> where S: AsyncRead + AsyncWrite + Unpin, { - let msg = msg.map(|msg| msg.into_owned()); self.send(Message::Close(msg)).await } }