Skip to content

Commit 04fbfd5

Browse files
committed
cleaned up imports
1 parent 5c537e5 commit 04fbfd5

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

futures-core/src/executor.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Executors.
22
3-
use task::TaskObj;
4-
53
pub use core::task::{Executor, SpawnErrorKind, SpawnObjError};
4+

futures-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Core traits and types for asynchronous operations in Rust.
22
33
#![feature(pin, arbitrary_self_types)]
4+
#![feature(futures_api)]
45

56
#![no_std]
67
#![deny(missing_docs, missing_debug_implementations, warnings)]

futures-core/src/task/context.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
use core::fmt;
21

3-
use executor::Executor;
4-
use task::{TaskObj, Waker};
5-
6-
use core::task::Context;
2+
pub use core::task::Context;
73

84
if_std! {
95
use Future;
6+
use task::TaskObj;
107

118
pub trait ContextExt {
129
/// Spawn a future onto the default executor.

futures-core/src/task/mod.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
//! Task notification.
22
33
use core::mem::{self, PinMut};
4-
use core::fmt;
54

65
use {Future, Poll};
76

8-
mod wake;
9-
pub use self::wake::{UnsafeWake, Waker};
7+
pub use core::task::{UnsafeWake, Waker};
108
#[cfg(feature = "std")]
11-
pub use self::wake::Wake;
9+
pub use std::task::Wake;
1210

1311
mod context;
1412
pub use self::context::Context;
@@ -20,10 +18,11 @@ pub use self::atomic_waker::AtomicWaker;
2018

2119
pub use core::task::{TaskObj, UnsafePoll};
2220

23-
// should be in std
21+
2422
if_std! {
2523
use std::boxed::Box;
2624

25+
// should be in std
2726
unsafe impl<F: Future<Output = ()> + Send + 'static> UnsafePoll for Box<F> {
2827
fn into_raw(self) -> *mut () {
2928
unsafe {
@@ -44,9 +43,14 @@ if_std! {
4443
}
4544
}
4645

47-
impl TaskObj {
46+
pub trait TaskObjExt {
47+
/// Create a new `TaskObj` by boxing the given future.
48+
fn new<F: Future<Output = ()> + Send + 'static>(f: F) -> TaskObj;
49+
}
50+
51+
impl TaskObjExt for TaskObj {
4852
/// Create a new `TaskObj` by boxing the given future.
49-
pub fn new<F: Future<Output = ()> + Send + 'static>(f: F) -> TaskObj {
53+
fn new<F: Future<Output = ()> + Send + 'static>(f: F) -> TaskObj {
5054
TaskObj::from_poll_task(Box::new(f))
5155
}
5256
}

futures-core/src/task/wake.rs

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)