@@ -19,11 +19,10 @@ First, let's add a shutdown channel to the `connection_loop`:
19
19
20
20
``` rust,edition2018
21
21
# extern crate async_std;
22
- # extern crate futures_channel;
23
- # extern crate futures_util;
22
+ # extern crate futures;
24
23
# use async_std::net::TcpStream;
25
- # use futures_channel ::mpsc;
26
- # use futures_util ::SinkExt;
24
+ # use futures::channel ::mpsc;
25
+ # use futures ::SinkExt;
27
26
# use std::sync::Arc;
28
27
#
29
28
# type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;
@@ -70,11 +69,10 @@ We use the `select` macro for this purpose:
70
69
71
70
``` rust,edition2018
72
71
# extern crate async_std;
73
- # extern crate futures_channel;
74
- # extern crate futures_util;
72
+ # extern crate futures;
75
73
# use async_std::{net::TcpStream, prelude::*};
76
- use futures_channel ::mpsc;
77
- use futures_util ::{select, FutureExt};
74
+ use futures::channel ::mpsc;
75
+ use futures ::{select, FutureExt};
78
76
# use std::sync::Arc;
79
77
80
78
# type Receiver<T> = mpsc::UnboundedReceiver<T>;
@@ -122,16 +120,15 @@ The final code looks like this:
122
120
123
121
``` rust,edition2018
124
122
# extern crate async_std;
125
- # extern crate futures_channel;
126
- # extern crate futures_util;
123
+ # extern crate futures;
127
124
use async_std::{
128
125
io::BufReader,
129
126
net::{TcpListener, TcpStream, ToSocketAddrs},
130
127
prelude::*,
131
128
task,
132
129
};
133
- use futures_channel ::mpsc;
134
- use futures_util ::{select, FutureExt, SinkExt};
130
+ use futures::channel ::mpsc;
131
+ use futures ::{select, FutureExt, SinkExt};
135
132
use std::{
136
133
collections::hash_map::{Entry, HashMap},
137
134
future::Future,
0 commit comments