Skip to content

Commit 2d23077

Browse files
Update to new tungstenite and bump version
1 parent 015e00d commit 2d23077

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.0
2+
3+
- Update `tungstenite` to `0.25.0` ([important updates!](https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md#0250)).
4+
15
# 0.24.0
26

37
- Update dependencies (TLS, tungstenite).

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ keywords = ["websocket", "io", "web"]
66
authors = ["Daniel Abramov <[email protected]>", "Alexey Galakhov <[email protected]>"]
77
license = "MIT"
88
homepage = "https://github.com/snapview/tokio-tungstenite"
9-
documentation = "https://docs.rs/tokio-tungstenite/0.24.0"
9+
documentation = "https://docs.rs/tokio-tungstenite/0.25.0"
1010
repository = "https://github.com/snapview/tokio-tungstenite"
11-
version = "0.24.0"
11+
version = "0.25.0"
1212
edition = "2018"
1313
rust-version = "1.63"
1414
include = ["examples/**/*", "src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]
@@ -34,7 +34,7 @@ futures-util = { version = "0.3.28", default-features = false, features = ["sink
3434
tokio = { version = "1.0.0", default-features = false, features = ["io-util"] }
3535

3636
[dependencies.tungstenite]
37-
version = "0.24.0"
37+
version = "0.25.0"
3838
default-features = false
3939

4040
[dependencies.native-tls-crate]

examples/autobahn-client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async fn get_case_count() -> Result<u32> {
1111
let (mut socket, _) = connect_async("ws://localhost:9001/getCaseCount").await?;
1212
let msg = socket.next().await.expect("Can't fetch case count")?;
1313
socket.close(None).await?;
14-
Ok(msg.into_text()?.parse::<u32>().expect("Can't parse case count"))
14+
Ok(msg.to_text()?.parse::<u32>().expect("Can't parse case count"))
1515
}
1616

1717
async fn update_reports() -> Result<()> {

examples/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async fn main() {
3333
let ws_to_stdout = {
3434
read.for_each(|message| async {
3535
let data = message.unwrap().into_data();
36-
tokio::io::stdout().write_all(&data).await.unwrap();
36+
tokio::io::stdout().write_all(&data.as_slice()).await.unwrap();
3737
})
3838
};
3939

examples/interval-server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async fn handle_connection(peer: SocketAddr, stream: TcpStream) -> Result<()> {
4040
}
4141
}
4242
_ = interval.tick() => {
43-
ws_sender.send(Message::Text("tick".to_owned())).await?;
43+
ws_sender.send(Message::text("tick")).await?;
4444
}
4545
}
4646
}

tests/communication.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async fn communication() {
5555

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

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

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

101101
tx.close().await.expect("Failed to close");

0 commit comments

Comments
 (0)