diff --git a/crates/cgp-async/src/lib.rs b/crates/cgp-async/src/lib.rs index 82224f57..b9c57ee0 100644 --- a/crates/cgp-async/src/lib.rs +++ b/crates/cgp-async/src/lib.rs @@ -6,4 +6,4 @@ pub mod traits; pub use cgp_async_macro::native_async as async_trait; #[cfg(not(feature = "async"))] pub use cgp_sync::async_trait; -pub use traits::{Async, MaybeSend, MaybeStatic, MaybeSync}; +pub use traits::{Async, MaybeSend, MaybeSync}; diff --git a/crates/cgp-async/src/traits/async.rs b/crates/cgp-async/src/traits/async.rs index 31e68fe5..8c52551e 100644 --- a/crates/cgp-async/src/traits/async.rs +++ b/crates/cgp-async/src/traits/async.rs @@ -1,4 +1,3 @@ -use crate::traits::r#static::MaybeStatic; use crate::traits::send::MaybeSend; use crate::traits::sync::MaybeSync; @@ -6,6 +5,6 @@ use crate::traits::sync::MaybeSync; This is defined as a convenient constraint alias to `Send + Sync + 'static`. */ -pub trait Async: MaybeSend + MaybeSync + MaybeStatic {} +pub trait Async: MaybeSend + MaybeSync {} -impl Async for A where A: MaybeSend + MaybeSync + MaybeStatic {} +impl Async for A where A: MaybeSend + MaybeSync {} diff --git a/crates/cgp-async/src/traits/mod.rs b/crates/cgp-async/src/traits/mod.rs index d918d010..a16d3548 100644 --- a/crates/cgp-async/src/traits/mod.rs +++ b/crates/cgp-async/src/traits/mod.rs @@ -1,9 +1,7 @@ pub mod r#async; pub mod send; -pub mod r#static; pub mod sync; pub use r#async::Async; -pub use r#static::MaybeStatic; pub use send::MaybeSend; pub use sync::MaybeSync; diff --git a/crates/cgp-async/src/traits/static.rs b/crates/cgp-async/src/traits/static.rs deleted file mode 100644 index 093b9711..00000000 --- a/crates/cgp-async/src/traits/static.rs +++ /dev/null @@ -1,11 +0,0 @@ -#[cfg(feature = "static")] -pub trait MaybeStatic: 'static {} - -#[cfg(feature = "static")] -impl MaybeStatic for T {} - -#[cfg(not(feature = "static"))] -pub trait MaybeStatic {} - -#[cfg(not(feature = "static"))] -impl MaybeStatic for T {} diff --git a/crates/cgp-core/src/prelude.rs b/crates/cgp-core/src/prelude.rs index 7d48d80d..e6cea566 100644 --- a/crates/cgp-core/src/prelude.rs +++ b/crates/cgp-core/src/prelude.rs @@ -1,4 +1,4 @@ -pub use cgp_async::{async_trait, Async, MaybeSend, MaybeStatic, MaybeSync}; +pub use cgp_async::{async_trait, Async, MaybeSend, MaybeSync}; pub use cgp_component::{ CanUseComponent, DelegateComponent, HasProvider, IsProviderFor, UseContext, UseFields, WithContext, WithProvider, diff --git a/crates/cgp-macro-lib/src/derive_component/provider_impl.rs b/crates/cgp-macro-lib/src/derive_component/provider_impl.rs index 4f1197e4..c47d8314 100644 --- a/crates/cgp-macro-lib/src/derive_component/provider_impl.rs +++ b/crates/cgp-macro-lib/src/derive_component/provider_impl.rs @@ -109,7 +109,7 @@ pub fn derive_provider_impl( return Err(Error::new( trait_item.span(), format!("unsupported trait item: {trait_item:?}"), - )) + )); } } } diff --git a/crates/cgp-macro-lib/src/derive_component/use_context_impl.rs b/crates/cgp-macro-lib/src/derive_component/use_context_impl.rs index 47e4df2d..8a673378 100644 --- a/crates/cgp-macro-lib/src/derive_component/use_context_impl.rs +++ b/crates/cgp-macro-lib/src/derive_component/use_context_impl.rs @@ -65,7 +65,7 @@ pub fn derive_use_context_impl( return Err(Error::new( trait_item.span(), format!("unsupported trait item: {trait_item:?}"), - )) + )); } } } diff --git a/crates/cgp-macro-lib/src/derive_getter/parse.rs b/crates/cgp-macro-lib/src/derive_getter/parse.rs index f2a01c1c..1278d3c3 100644 --- a/crates/cgp-macro-lib/src/derive_getter/parse.rs +++ b/crates/cgp-macro-lib/src/derive_getter/parse.rs @@ -30,7 +30,7 @@ pub fn parse_getter_fields( return Err(Error::new( item.span(), "getter trait can only contain getter methods", - )) + )); } } } diff --git a/crates/cgp-macro-lib/src/entrypoints/derive_has_fields.rs b/crates/cgp-macro-lib/src/entrypoints/derive_has_fields.rs index b6853308..8e992c58 100644 --- a/crates/cgp-macro-lib/src/entrypoints/derive_has_fields.rs +++ b/crates/cgp-macro-lib/src/entrypoints/derive_has_fields.rs @@ -16,7 +16,7 @@ pub fn derive_has_fields(body: TokenStream) -> syn::Result { return Err(Error::new_spanned( item, "expect body to be either a struct or enum", - )) + )); } };