aboutsummaryrefslogtreecommitdiff
path: root/src/async_di_container.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-10-03 20:23:26 +0200
committerHampusM <hampus@hampusmat.com>2022-10-03 20:45:32 +0200
commit97c789e38bb8e61389a3808d241689e623144344 (patch)
tree4cbaee424bfcb1b69a523be9664e48e5264f3d4b /src/async_di_container.rs
parent03d3898a05592eb83b7a16609dba46d0b293790e (diff)
refactor: remove relying on Rust nightly for better handling of features
Diffstat (limited to 'src/async_di_container.rs')
-rw-r--r--src/async_di_container.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/async_di_container.rs b/src/async_di_container.rs
index ab74b4c..3943dae 100644
--- a/src/async_di_container.rs
+++ b/src/async_di_container.rs
@@ -54,7 +54,6 @@ use std::any::type_name;
use std::marker::PhantomData;
use std::sync::Arc;
-use feature_macros::feature_specific;
use tokio::sync::Mutex;
#[cfg(feature = "factory")]
@@ -79,7 +78,8 @@ use crate::provider::r#async::{
use crate::ptr::{SomeThreadsafePtr, ThreadsafeSingletonPtr, TransientPtr};
/// Alias for a threadsafe boxed function.
-#[feature_specific("factory")]
+#[cfg(feature = "factory")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))]
pub type BoxFn<Args, Return> = Box<(dyn Fn<Args, Output = Return> + Send + Sync)>;
/// When configurator for a binding for type 'Interface' inside a [`AsyncDIContainer`].
@@ -330,7 +330,8 @@ where
/// # Ok(())
/// # }
/// ```
- #[feature_specific("factory")]
+ #[cfg(feature = "factory")]
+ #[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))]
pub async fn to_factory<Args, Return, FactoryFunc>(
&self,
factory_func: &'static FactoryFunc,
@@ -415,7 +416,8 @@ where
/// # Ok(())
/// # }
/// ```
- #[feature_specific("factory")]
+ #[cfg(feature = "factory")]
+ #[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))]
pub async fn to_async_factory<Args, Return, FactoryFunc>(
&self,
factory_func: &'static FactoryFunc,
@@ -501,7 +503,8 @@ where
/// # Ok(())
/// # }
/// ```
- #[feature_specific("factory")]
+ #[cfg(feature = "factory")]
+ #[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))]
pub async fn to_default_factory<Return, FactoryFunc>(
&self,
factory_func: &'static FactoryFunc,
@@ -587,7 +590,8 @@ where
/// # Ok(())
/// # }
/// ```
- #[feature_specific("factory")]
+ #[cfg(feature = "factory")]
+ #[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))]
pub async fn to_async_default_factory<Return, FactoryFunc>(
&self,
factory_func: &'static FactoryFunc,