Skip to content

Commit 1ec893f

Browse files
committed
fix(dispatcher): use DispatchError
1 parent f474bb9 commit 1ec893f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compio-dispatcher/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::{
1313

1414
use compio_driver::{AsyncifyPool, DispatchError, Dispatchable, ProactorBuilder};
1515
use compio_runtime::{event::Event, JoinHandle as CompioJoinHandle, Runtime};
16-
use flume::{unbounded, SendError, Sender};
16+
use flume::{unbounded, Sender};
1717
use futures_channel::oneshot;
1818

1919
type Spawning = Box<dyn Spawnable + Send>;
@@ -142,7 +142,7 @@ impl Dispatcher {
142142
///
143143
/// If all threads have panicked, this method will return an error with the
144144
/// sent closure.
145-
pub fn dispatch<Fn, Fut, R>(&self, f: Fn) -> Result<oneshot::Receiver<R>, SendError<Fn>>
145+
pub fn dispatch<Fn, Fut, R>(&self, f: Fn) -> Result<oneshot::Receiver<R>, DispatchError<Fn>>
146146
where
147147
Fn: (FnOnce() -> Fut) + Send + 'static,
148148
Fut: Future<Output = R> + 'static,
@@ -156,7 +156,7 @@ impl Dispatcher {
156156
// SAFETY: We know the dispatchable we sent has type `Concrete<Fn, R>`
157157
let recovered =
158158
unsafe { Box::from_raw(Box::into_raw(err.0) as *mut Concrete<Fn, R>) };
159-
Err(SendError(recovered.func))
159+
Err(DispatchError(recovered.func))
160160
}
161161
}
162162
}

0 commit comments

Comments
 (0)