*: Remove usage of custom buffer initialization usage (#1263)

* *: Remove usage of custom buffer initialization usage

With version `0.3.0-alpha.19` the futures-preview crate makes the
`AsyncRead::initializer` API unstable.

In order to improve interoperability with e.g. both a library depending
on alpha.18 as well as a library depending on alpha.19 and in order for
rust-libp2p to become stable again, this commit removes all usages of
the unstable `initializer` API.

* protocols/noise: Remove NoiseOutput Asyncread initializer

* transports/tcp: Remove TcpTransStream AsyncRead initializer

* *: Remove version pinning of futures-preview to 0.3.0-alpha.18

With version 0.3.0-alpha.19 the futures-preview crate makes the
AsyncRead::initializer API unstable. Given that the previous commits
removed usage of the initializer API, the version pinning is not needed
any longer.
This commit is contained in:
Max Inden
2019-11-01 16:53:11 +01:00
committed by Toralf Wittner
parent 0eeddac86f
commit 8944899fe0
14 changed files with 10 additions and 79 deletions

View File

@ -27,7 +27,7 @@
//! > **Note**: Although this crate is hosted in the libp2p repo, it is purely a utility crate and
//! > not at all specific to libp2p.
use futures::{prelude::*, io::Initializer};
use futures::prelude::*;
use std::{cmp, io, pin::Pin, task::Context, task::Poll};
/// Wraps around a `Stream + Sink` whose items are buffers. Implements `AsyncRead` and `AsyncWrite`.
@ -74,10 +74,6 @@ where
for _ in 0..to_copy { current_item.remove(0); }
Poll::Ready(Ok(to_copy))
}
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
}
}
impl<S> AsyncWrite for RwStreamSink<S>