Skip to content

Commit c9bfb6f

Browse files
committed
experimental: rename futures 0.1 dependency
1 parent 2ca7f2d commit c9bfb6f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

futures-util/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cargo-features = ["edition"]
1+
cargo-features = ["edition", "rename-dependency"]
22

33
[package]
44
name = "futures-util-preview"
@@ -30,7 +30,7 @@ futures-io-preview = { path = "../futures-io", version = "0.3.0-alpha.1", defaul
3030
futures-sink-preview = { path = "../futures-sink", version = "0.3.0-alpha.1", default-features = false}
3131
either = { version = "1.4", default-features = false }
3232
slab = { version = "0.4", optional = true }
33-
futures = { version = "0.1", optional = true }
33+
futures01 = { version = "0.1", optional = true, package = "futures" }
3434

3535
[dev-dependencies]
3636
futures-preview = { path = "../futures", version = "0.3.0-alpha.1" }

futures-util/src/compat/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//! Futures 0.1 / 0.3 shims
2-
//!
2+
//!
33
44
#![allow(missing_debug_implementations)]
55

6-
use futures::Future as Future01;
7-
use futures::Poll as Poll01;
8-
use futures::task as task01;
9-
use futures::task::Task as Task01;
10-
use futures::executor::{with_notify, NotifyHandle, Notify, UnsafeNotify};
6+
use futures01::Future as Future01;
7+
use futures01::Poll as Poll01;
8+
use futures01::task as task01;
9+
use futures01::task::Task as Task01;
10+
use futures01::executor::{with_notify, NotifyHandle, Notify, UnsafeNotify};
1111

1212
use futures_core::Future as Future03;
1313
use futures_core::TryFuture as TryFuture03;
@@ -25,7 +25,7 @@ use std::sync::Arc;
2525
#[derive(Debug)]
2626
#[must_use = "futures do nothing unless polled"]
2727
pub struct Compat<Fut, E> {
28-
crate inner: Fut,
28+
crate inner: Fut,
2929
crate executor: Option<E>,
3030
}
3131

@@ -48,11 +48,11 @@ impl<T> Future03 for Compat<T, ()> where T: Future01 {
4848
type Output = Result<T::Item, T::Error>;
4949

5050
fn poll(self: PinMut<Self>, cx: &mut task::Context) -> Poll03<Self::Output> {
51-
use futures::Async;
51+
use futures01::Async;
5252

5353
let notify = &WakerToHandle(cx.waker());
5454

55-
with_notify(notify, 0, move || {
55+
with_notify(notify, 0, move || {
5656
unsafe {
5757
match PinMut::get_mut_unchecked(self).inner.poll() {
5858
Ok(Async::Ready(t)) => Poll03::Ready(Ok(t)),
@@ -106,7 +106,7 @@ impl<T, E> Future01 for Compat<T, E> where T: TryFuture03 + Unpin,
106106
type Error = T::Error;
107107

108108
fn poll(&mut self) -> Poll01<Self::Item, Self::Error> {
109-
use futures::Async;
109+
use futures01::Async;
110110

111111
let waker = current_as_waker();
112112
let mut cx = task::Context::new(&waker, self.executor.as_mut().unwrap());

0 commit comments

Comments
 (0)