Skip to content

Commit

Permalink
Update to new tungstenite and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-abramov committed Dec 15, 2024
1 parent 015e00d commit 2d23077
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.0

- Update `tungstenite` to `0.25.0` ([important updates!](https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md#0250)).

# 0.24.0

- Update dependencies (TLS, tungstenite).
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ keywords = ["websocket", "io", "web"]
authors = ["Daniel Abramov <[email protected]>", "Alexey Galakhov <[email protected]>"]
license = "MIT"
homepage = "https://github.com/snapview/tokio-tungstenite"
documentation = "https://docs.rs/tokio-tungstenite/0.24.0"
documentation = "https://docs.rs/tokio-tungstenite/0.25.0"
repository = "https://github.com/snapview/tokio-tungstenite"
version = "0.24.0"
version = "0.25.0"
edition = "2018"
rust-version = "1.63"
include = ["examples/**/*", "src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]
Expand All @@ -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.24.0"
version = "0.25.0"
default-features = false

[dependencies.native-tls-crate]
Expand Down
2 changes: 1 addition & 1 deletion examples/autobahn-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async fn get_case_count() -> Result<u32> {
let (mut socket, _) = connect_async("ws://localhost:9001/getCaseCount").await?;
let msg = socket.next().await.expect("Can't fetch case count")?;
socket.close(None).await?;
Ok(msg.into_text()?.parse::<u32>().expect("Can't parse case count"))
Ok(msg.to_text()?.parse::<u32>().expect("Can't parse case count"))
}

async fn update_reports() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion examples/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).await.unwrap();
tokio::io::stdout().write_all(&data.as_slice()).await.unwrap();
})
};

Expand Down
2 changes: 1 addition & 1 deletion examples/interval-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async fn handle_connection(peer: SocketAddr, stream: TcpStream) -> Result<()> {
}
}
_ = interval.tick() => {
ws_sender.send(Message::Text("tick".to_owned())).await?;
ws_sender.send(Message::text("tick")).await?;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/communication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async fn communication() {

for i in 1..10 {
info!("Sending message");
stream.send(Message::Text(format!("{}", i))).await.expect("Failed to send message");
stream.send(Message::text(format!("{}", i))).await.expect("Failed to send message");
}

stream.close(None).await.expect("Failed to close");
Expand Down Expand Up @@ -95,7 +95,7 @@ async fn split_communication() {

for i in 1..10 {
info!("Sending message");
tx.send(Message::Text(format!("{}", i))).await.expect("Failed to send message");
tx.send(Message::text(format!("{}", i))).await.expect("Failed to send message");
}

tx.close().await.expect("Failed to close");
Expand Down

0 comments on commit 2d23077

Please sign in to comment.