mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-22 04:32:13 +00:00
Fix compile errors on nightly
This commit is contained in:
parent
39b5f1845d
commit
2a665a92fd
@ -79,11 +79,8 @@ fn oneshot_works() -> impl Future<Item = (), Error = JsValue> {
|
|||||||
#[wasm_bindgen_test(async)]
|
#[wasm_bindgen_test(async)]
|
||||||
fn spawn_local_runs() -> impl Future<Item = (), Error = JsValue> {
|
fn spawn_local_runs() -> impl Future<Item = (), Error = JsValue> {
|
||||||
let (tx, rx) = oneshot::channel::<u32>();
|
let (tx, rx) = oneshot::channel::<u32>();
|
||||||
let fn_box = Box::new(move || {
|
|
||||||
tx.send(42).unwrap();
|
|
||||||
});
|
|
||||||
spawn_local(futures::future::ok::<(), ()>(()).map(|_| {
|
spawn_local(futures::future::ok::<(), ()>(()).map(|_| {
|
||||||
fn_box();
|
tx.send(42).unwrap();
|
||||||
}));
|
}));
|
||||||
rx.then(|val| {
|
rx.then(|val| {
|
||||||
if val == Ok(42) {
|
if val == Ok(42) {
|
||||||
@ -98,13 +95,10 @@ fn spawn_local_runs() -> impl Future<Item = (), Error = JsValue> {
|
|||||||
#[wasm_bindgen_test(async)]
|
#[wasm_bindgen_test(async)]
|
||||||
fn spawn_local_err_no_exception() -> impl Future<Item = (), Error = JsValue> {
|
fn spawn_local_err_no_exception() -> impl Future<Item = (), Error = JsValue> {
|
||||||
let (tx, rx) = oneshot::channel::<u32>();
|
let (tx, rx) = oneshot::channel::<u32>();
|
||||||
let fn_box = Box::new(move || {
|
|
||||||
tx.send(42).unwrap();
|
|
||||||
});
|
|
||||||
// Promises should run in a deterministic order, so the `err` should be handled during the execution of this test.
|
// Promises should run in a deterministic order, so the `err` should be handled during the execution of this test.
|
||||||
spawn_local(futures::future::err::<(), ()>(()));
|
spawn_local(futures::future::err::<(), ()>(()));
|
||||||
spawn_local(futures::future::ok::<(), ()>(()).map(|_| {
|
spawn_local(futures::future::ok::<(), ()>(()).map(move |_| {
|
||||||
fn_box();
|
tx.send(42).unwrap();
|
||||||
}));
|
}));
|
||||||
rx.then(|val| {
|
rx.then(|val| {
|
||||||
if val == Ok(42) {
|
if val == Ok(42) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user