Skip to content

Commit

Permalink
refactor(core): MaybeSend does not need to be unsafe (#5338)
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer authored Nov 18, 2024
1 parent d7eb774 commit c8e43a8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/raw/futures_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ pub type BoxedStaticFuture<T> = futures::future::LocalBoxFuture<'static, T>;
///
/// # Safety
///
/// MaybeSend equivalent to `Send` on non-wasm32 target. And it's empty
/// on wasm32 target.
/// [`MaybeSend`] is equivalent to `Send` on non-wasm32 target.
/// And it's empty trait on wasm32 target to indicate that a type is not `Send`.
#[cfg(not(target_arch = "wasm32"))]
pub unsafe trait MaybeSend: Send {}
pub trait MaybeSend: Send {}
#[cfg(target_arch = "wasm32")]
pub unsafe trait MaybeSend {}
pub trait MaybeSend {}

#[cfg(not(target_arch = "wasm32"))]
unsafe impl<T: Send> MaybeSend for T {}
impl<T: Send> MaybeSend for T {}
#[cfg(target_arch = "wasm32")]
unsafe impl<T> MaybeSend for T {}
impl<T> MaybeSend for T {}

/// ConcurrentTasks is used to execute tasks concurrently.
///
Expand Down

0 comments on commit c8e43a8

Please sign in to comment.