From 61fe33fbf638a8d40a35346b5155e2cdc4a4ebb5 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 28 Oct 2019 08:33:10 -0700 Subject: [PATCH] remove unused rayon dep from the promise crate --- promise/Cargo.toml | 1 - promise/src/lib.rs | 28 ---------------------------- 2 files changed, 29 deletions(-) diff --git a/promise/Cargo.toml b/promise/Cargo.toml index d0012899d..cba2bc23b 100644 --- a/promise/Cargo.toml +++ b/promise/Cargo.toml @@ -7,4 +7,3 @@ edition = "2018" [dependencies] failure = "0.1" failure_derive = "0.1" -rayon = "1.0" diff --git a/promise/src/lib.rs b/promise/src/lib.rs index 904f85d91..2022e4752 100644 --- a/promise/src/lib.rs +++ b/promise/src/lib.rs @@ -31,28 +31,6 @@ impl Executor for Box { } } -/// 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 { - Box::new(RayonExecutor::new()) - } -} - enum PromiseState { Waiting(Arc>), 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); - } }