Switch to stable futures (#1196)

* Switch to stable futures

* Remove from_fn

* Fix secio

* Fix core --lib tests
This commit is contained in:
Pierre Krieger
2019-09-16 11:08:44 +02:00
committed by GitHub
parent 8c119269d6
commit 170d2d268f
105 changed files with 3193 additions and 5594 deletions

View File

@ -18,7 +18,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
use futures::future::{self, FutureResult};
use futures::future::{self, Ready};
use libp2p_core::{InboundUpgrade, OutboundUpgrade, UpgradeInfo, upgrade::Negotiated};
use std::iter;
use void::Void;
@ -38,20 +38,20 @@ impl UpgradeInfo for PlainTextConfig {
impl<C> InboundUpgrade<C> for PlainTextConfig {
type Output = Negotiated<C>;
type Error = Void;
type Future = FutureResult<Negotiated<C>, Self::Error>;
type Future = Ready<Result<Negotiated<C>, Self::Error>>;
fn upgrade_inbound(self, i: Negotiated<C>, _: Self::Info) -> Self::Future {
future::ok(i)
future::ready(Ok(i))
}
}
impl<C> OutboundUpgrade<C> for PlainTextConfig {
type Output = Negotiated<C>;
type Error = Void;
type Future = FutureResult<Negotiated<C>, Self::Error>;
type Future = Ready<Result<Negotiated<C>, Self::Error>>;
fn upgrade_outbound(self, i: Negotiated<C>, _: Self::Info) -> Self::Future {
future::ok(i)
future::ready(Ok(i))
}
}