From ae34736d5fd00df85ebfc13749485d789bc1d4c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Mon, 18 Nov 2024 12:04:36 +0800 Subject: [PATCH] refactor: MaybeSend does not need to be unsafe --- core/src/raw/futures_util.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/raw/futures_util.rs b/core/src/raw/futures_util.rs index 3abf645b1c5c..3d182bf49ab9 100644 --- a/core/src/raw/futures_util.rs +++ b/core/src/raw/futures_util.rs @@ -49,17 +49,17 @@ pub type BoxedStaticFuture = 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 MaybeSend for T {} +impl MaybeSend for T {} #[cfg(target_arch = "wasm32")] -unsafe impl MaybeSend for T {} +impl MaybeSend for T {} /// ConcurrentTasks is used to execute tasks concurrently. ///