From 4e7cbbf98ab745351e2fb13a7c85d4ad560c21ee Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 14 Jun 2024 01:57:49 +0200 Subject: Move `Maybe*` traits back to `iced_futures` --- core/src/lib.rs | 2 -- core/src/maybe.rs | 35 ----------------------------------- 2 files changed, 37 deletions(-) delete mode 100644 core/src/maybe.rs (limited to 'core') diff --git a/core/src/lib.rs b/core/src/lib.rs index db67219c..32156441 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -35,7 +35,6 @@ mod color; mod content_fit; mod element; mod length; -mod maybe; mod padding; mod pixels; mod point; @@ -60,7 +59,6 @@ pub use font::Font; pub use gradient::Gradient; pub use layout::Layout; pub use length::Length; -pub use maybe::{MaybeSend, MaybeSync}; pub use overlay::Overlay; pub use padding::Padding; pub use pixels::Pixels; diff --git a/core/src/maybe.rs b/core/src/maybe.rs deleted file mode 100644 index c6a507c1..00000000 --- a/core/src/maybe.rs +++ /dev/null @@ -1,35 +0,0 @@ -#[cfg(not(target_arch = "wasm32"))] -mod platform { - /// An extension trait that enforces `Send` only on native platforms. - /// - /// Useful for writing cross-platform async code! - pub trait MaybeSend: Send {} - - impl MaybeSend for T where T: Send {} - - /// An extension trait that enforces `Sync` only on native platforms. - /// - /// Useful for writing cross-platform async code! - pub trait MaybeSync: Sync {} - - impl MaybeSync for T where T: Sync {} -} - -#[cfg(target_arch = "wasm32")] -mod platform { - /// An extension trait that enforces `Send` only on native platforms. - /// - /// Useful for writing cross-platform async code! - pub trait MaybeSend {} - - impl MaybeSend for T {} - - /// An extension trait that enforces `Sync` only on native platforms. - /// - /// Useful for writing cross-platform async code! - pub trait MaybeSync {} - - impl MaybeSync for T {} -} - -pub use platform::{MaybeSend, MaybeSync}; -- cgit