Closed
Description
It seems that functions and methods which return js_sys::Promise
(e.g., when creating bindings with wasm-bindgen
) should probably always be marked as #[must_use]
. If you invoke something which returns a Promise
and then just discard it, the computation does nothing.
In order to do something useful you either have to pass the resulting Promise
on to some other JS computation or convert it to a JsFuture
and .await
it in some async context.
There could be a lint which suggests that #[must_use]
should be added for these cases to remind the user to consume the Promise
.
Does this sound like something that would be appropriate as a clippy lint?
Metadata
Metadata
Assignees
Labels
No labels