Przeglądaj źródła

futures_tokio_compat is not needed anymore.

Mathias Gottschlag 5 lat temu
rodzic
commit
65cff3fc69
3 zmienionych plików z 2 dodań i 4 usunięć
  1. 0
    1
      Cargo.lock
  2. 0
    1
      Cargo.toml
  3. 2
    2
      src/bin/server.rs

+ 0
- 1
Cargo.lock Wyświetl plik

@@ -936,7 +936,6 @@ dependencies = [
936 936
  "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
937 937
  "fswatcher 0.1.0 (git+https://github.com/mgottschlag/fswatcher-rs.git)",
938 938
  "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
939
- "futures-tokio-compat 0.1.0 (git+https://github.com/mgottschlag/futures-tokio-compat.git)",
940 939
  "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
941 940
  "rmp-serde 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)",
942 941
  "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",

+ 0
- 1
Cargo.toml Wyświetl plik

@@ -12,7 +12,6 @@ dirs = "2.0"
12 12
 byteorder = "1.3"
13 13
 tokio = { version = "0.2", features = ["fs", "io-util", "macros", "net", "rt-threaded", "stream", "sync", "tcp", "time"] }
14 14
 futures = "0.3.1"
15
-futures-tokio-compat = { git = "https://github.com/mgottschlag/futures-tokio-compat.git" }
16 15
 async-tungstenite = { version = "0.3", features = ["tokio-runtime"] }
17 16
 env_logger = "0.7"
18 17
 log = "0.4"

+ 2
- 2
src/bin/server.rs Wyświetl plik

@@ -3,8 +3,8 @@ use std::net::SocketAddr;
3 3
 use std::sync::{Arc, Mutex};
4 4
 
5 5
 use async_tungstenite::accept_async;
6
+use async_tungstenite::tokio::TokioAdapter;
6 7
 use futures::sink::SinkExt;
7
-use futures_tokio_compat::Compat;
8 8
 use log::*;
9 9
 use tokio::net::{TcpListener, TcpStream};
10 10
 use tokio::stream::StreamExt;
@@ -65,7 +65,7 @@ async fn main() {
65 65
 // TODO: Robust error handling.
66 66
 
67 67
 async fn accept_connection(peer: SocketAddr, stream: TcpStream) {
68
-    let mut ws_stream = accept_async(Compat::new(stream))
68
+    let mut ws_stream = accept_async(TokioAdapter(stream))
69 69
         .await
70 70
         .expect("Failed to accept");
71 71
 

Ładowanie…
Anuluj
Zapisz