Open
Description
We have a lot of places in code where we use a condition on target_arch = "wasm32"
(though, most should probably be target_family = "wasm"
) to constrain to Send
but this requires a lot of boilerplate code. Instead, we could define a trait (typedefs don't work in all places) like bevy does, though probably using distinct mods e.g.,
#[cfg(target_arch = "wasm32")]
mod conditional_send {
pub trait ConditionalSend {}
impl<T> ConditionalSend for T {}
}
#[cfg(not(target_arch = "wasm32"))]
mod conditional_send {
pub trait ConditionalSend: Send {}
impl<T: Send> ConditionalSend for T {}
}
pub use conditional_send::*;
We'd need to go through and find all the places necessary. We'd have to leave async_trait
in place with a conditional Send
but many other places would be cleaned up.
Metadata
Metadata
Assignees
Type
Projects
Status
Untriaged