mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 05:12:40 +03:00
remove unused rayon dep from the promise crate
This commit is contained in:
parent
c8f39b9adf
commit
61fe33fbf6
@ -7,4 +7,3 @@ edition = "2018"
|
||||
[dependencies]
|
||||
failure = "0.1"
|
||||
failure_derive = "0.1"
|
||||
rayon = "1.0"
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user