matrix-rust-sdk
matrix-rust-sdk copied to clipboard
Ensure that most / all async methods in the SDK return futures that are `Send` (except on WASM)
Currently, we have #[cfg_attr(not(target_arch = "wasm32"), deny(clippy::future_not_send))]
in a few select places. We should apply it more broadly and fix all of the issues it finds.
We'll have to #[allow]
this lint for generic functions (for now): https://github.com/rust-lang/rust-clippy/issues/6947
Some progress is found here: https://github.com/matrix-org/matrix-rust-sdk/pull/3087
We're mostly Send
, the matrix-sdk-crypto crate is the only major one that isn't and mostly because it uses generic functions, though needs to be more carefully investigated to be completely certain.
Well spoke too soon, the main crate also has a bunch of them generic functions...
The fix here is to adjust clippy to check that generic fns return a send future for send generic args, not for non-send generic args.