Skip to content

Commit a1757fd

Browse files
authored
Merge pull request #21 from messense/tokio-1
Update to Tokio 1.0
2 parents e63275f + 10d7a9f commit a1757fd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ if-addrs = "0.6"
1515
hostname = "0.3"
1616
log = "0.4"
1717
multimap = "0.8"
18-
rand = "0.7"
18+
rand = "0.8"
1919
futures-util = "0.3"
20-
tokio = { version = "0.3.4", features = ["sync","net","stream","rt"] }
20+
tokio = { version = "1.0", features = ["sync","net","rt"] }
2121
quick-error = "1.2"
2222
socket2 = { version = "0.3.16", features = ["reuseport"] }
2323

2424
[dev-dependencies]
25-
env_logger = { version = "0.7", default-features = false, features = ["termcolor","humantime","atty"] }
25+
env_logger = { version = "0.8", default-features = false, features = ["termcolor","humantime","atty"] }

src/fsm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::{
1212
task::{Context, Poll},
1313
};
1414

15-
use tokio::{net::UdpSocket, stream::Stream, sync::mpsc};
15+
use tokio::{net::UdpSocket, sync::mpsc};
1616

1717
use super::{DEFAULT_TTL, MDNS_PORT};
1818
use crate::address_family::AddressFamily;
@@ -221,7 +221,7 @@ impl<AF: Unpin + AddressFamily> Future for FSM<AF> {
221221
type Output = ();
222222
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<()> {
223223
let pinned = Pin::get_mut(self);
224-
while let Poll::Ready(cmd) = Pin::new(&mut pinned.commands).poll_next(cx) {
224+
while let Poll::Ready(cmd) = Pin::new(&mut pinned.commands).poll_recv(cx) {
225225
match cmd {
226226
Some(Command::Shutdown) => return Poll::Ready(()),
227227
Some(Command::SendUnsolicited {
@@ -243,7 +243,7 @@ impl<AF: Unpin + AddressFamily> Future for FSM<AF> {
243243
Err(e) => error!("ResponderRecvPacket Error: {:?}", e),
244244
}
245245

246-
while let Some((ref response, ref addr)) = pinned.outgoing.pop_front() {
246+
while let Some((ref response, addr)) = pinned.outgoing.pop_front() {
247247
trace!("sending packet to {:?}", addr);
248248

249249
match pinned.socket.poll_send_to(cx, response, addr) {

0 commit comments

Comments
 (0)