Add spawn_local function
diff --git a/examples/panic-result.rs b/examples/panic-result.rs
index 7cf5a14..6308240 100644
--- a/examples/panic-result.rs
+++ b/examples/panic-result.rs
@@ -9,16 +9,19 @@
use futures::future::FutureExt;
use lazy_static::lazy_static;
+type Task = async_task::Task<()>;
+type JoinHandle<T> = async_task::JoinHandle<T, ()>;
+
/// Spawns a future on the executor.
-fn spawn<F, R>(future: F) -> async_task::JoinHandle<thread::Result<R>, ()>
+fn spawn<F, R>(future: F) -> JoinHandle<thread::Result<R>>
where
F: Future<Output = R> + Send + 'static,
R: Send + 'static,
{
lazy_static! {
// A channel that holds scheduled tasks.
- static ref QUEUE: Sender<async_task::Task<()>> = {
- let (sender, receiver) = unbounded::<async_task::Task<()>>();
+ static ref QUEUE: Sender<Task> = {
+ let (sender, receiver) = unbounded::<Task>();
// Start the executor thread.
thread::spawn(|| {