Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update if-watch requirement from 0.1.8 to 0.2.0 #1979

Merged
merged 4 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions transports/tcp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.27.2 [unreleased]

- Update to `if-watch-0.2`.

# 0.27.1 [2021-02-15]

- Update dependencies.
Expand Down
4 changes: 2 additions & 2 deletions transports/tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "libp2p-tcp"
edition = "2018"
description = "TCP/IP transport protocol for libp2p"
version = "0.27.1"
version = "0.27.2"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"]
async-io-crate = { package = "async-io", version = "1.2.0", optional = true }
futures = "0.3.8"
futures-timer = "3.0"
if-watch = { version = "0.1.8", optional = true }
if-watch = { version = "0.2.0", optional = true }
if-addrs = { version = "0.6.4", optional = true }
ipnet = "2.0.0"
libc = "0.2.80"
Expand Down
5 changes: 2 additions & 3 deletions transports/tcp/src/provider/async_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use super::{Provider, IfEvent, Incoming};
use async_io_crate::Async;
use futures::{
future::{BoxFuture, FutureExt},
prelude::*,
};
use std::io;
use std::task::{Poll, Context};
Expand Down Expand Up @@ -75,9 +74,9 @@ impl Provider for Tcp {
}

fn poll_interfaces(w: &mut Self::IfWatcher, cx: &mut Context<'_>) -> Poll<io::Result<IfEvent>> {
w.next().map_ok(|e| match e {
w.poll_unpin(cx).map_ok(|e| match e {
if_watch::IfEvent::Up(a) => IfEvent::Up(a),
if_watch::IfEvent::Down(a) => IfEvent::Down(a),
}).boxed().poll_unpin(cx)
})
}
}