From 4e611c318e9b9c446fbe9fea7e48691272994989 Mon Sep 17 00:00:00 2001 From: lcnr/Bastian Kauschke Date: Sat, 12 Jan 2019 17:42:05 +0100 Subject: [PATCH] fix spawn_local --- crates/futures/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/futures/src/lib.rs b/crates/futures/src/lib.rs index dc1b30c7..d202519f 100644 --- a/crates/futures/src/lib.rs +++ b/crates/futures/src/lib.rs @@ -113,6 +113,7 @@ use std::sync::Arc; use futures::executor::{self, Notify, Spawn}; use futures::prelude::*; +use futures::future; use futures::sync::oneshot; use js_sys::{Function, Promise}; use wasm_bindgen::prelude::*; @@ -393,6 +394,6 @@ where future_to_promise( future .map(|()| JsValue::undefined()) - .map_err(|()| JsValue::undefined()), + .or_else(|()| future::ok::(JsValue::undefined())), ); }