mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-25 14:12:13 +00:00
Mark js_sys::Promise as #[must_use] (#1927)
* Mark js_sys::Promise as #[must_use] * Fix js_sys::Promise #[must_use] warnings
This commit is contained in:
parent
7ed152276f
commit
624ff42eae
@ -158,7 +158,7 @@ impl From<Promise> for JsFuture {
|
|||||||
Closure::once(move |val| finish(&state, Err(val)))
|
Closure::once(move |val| finish(&state, Err(val)))
|
||||||
};
|
};
|
||||||
|
|
||||||
js.then2(&resolve, &reject);
|
let _ = js.then2(&resolve, &reject);
|
||||||
|
|
||||||
state.borrow_mut().callbacks = Some((resolve, reject));
|
state.borrow_mut().callbacks = Some((resolve, reject));
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ impl Queue {
|
|||||||
// eventually we should probably use something like `queueMicrotask`:
|
// eventually we should probably use something like `queueMicrotask`:
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask
|
// https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask
|
||||||
if !self.state.is_spinning.replace(true) {
|
if !self.state.is_spinning.replace(true) {
|
||||||
self.promise.then(&self.closure);
|
let _ = self.promise.then(&self.closure);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4567,6 +4567,7 @@ extern "C" {
|
|||||||
/// an asynchronous operation, and its resulting value.
|
/// an asynchronous operation, and its resulting value.
|
||||||
///
|
///
|
||||||
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
||||||
|
#[must_use]
|
||||||
#[wasm_bindgen(extends = Object)]
|
#[wasm_bindgen(extends = Object)]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub type Promise;
|
pub type Promise;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user