Move Maybe* traits back to iced_futures
This commit is contained in:
parent
4ab4ffc9cf
commit
4e7cbbf98a
11 changed files with 12 additions and 14 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<T> 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<T> 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<T> MaybeSend for T {}
|
||||
|
||||
/// An extension trait that enforces `Sync` only on native platforms.
|
||||
///
|
||||
/// Useful for writing cross-platform async code!
|
||||
pub trait MaybeSync {}
|
||||
|
||||
impl<T> MaybeSync for T {}
|
||||
}
|
||||
|
||||
pub use platform::{MaybeSend, MaybeSync};
|
||||
Loading…
Add table
Add a link
Reference in a new issue