remove unused rayon dep from the promise crate

This commit is contained in:
Wez Furlong committed 2019-10-28 14:31:10 -07:00
1 parent c8f39b9adf
commit 61fe33fbf6
2 files changed
-29

No files matched your search

-1
View File
@@ -7,4 +7,3 @@ edition = "2018"
[dependencies]
failure = "0.1"
failure_derive = "0.1"
rayon = "1.0"
-28
View File
@@ -31,28 +31,6 @@ impl Executor for Box<dyn Executor> {
}
}
/// An executor for spawning futures into the rayon global
/// thread pool
#[derive(Clone, Default)]
pub struct RayonExecutor {}
impl RayonExecutor {
pub fn new() -> Self {
Self {}
}
}
impl BasicExecutor for RayonExecutor {
fn execute(&self, f: SpawnFunc) {
rayon::spawn(f);
}
}
impl Executor for RayonExecutor {
fn clone_executor(&self) -> Box<dyn Executor> {
Box::new(RayonExecutor::new())
}
}
enum PromiseState<T> {
Waiting(Arc<Core<T>>),
Fulfilled,
@@ -436,10 +414,4 @@ mod test {
assert_eq!(f2.wait().unwrap(), 246);
}
#[test]
fn via_rayon() {
let f = Future::with_executor(RayonExecutor::new(), || Ok(true));
assert_eq!(f.wait().unwrap(), true);
}
}