diff options
author | HampusM <hampus@hampusmat.com> | 2022-10-03 20:23:26 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-10-03 20:45:32 +0200 |
commit | 97c789e38bb8e61389a3808d241689e623144344 (patch) | |
tree | 4cbaee424bfcb1b69a523be9664e48e5264f3d4b /src/lib.rs | |
parent | 03d3898a05592eb83b7a16609dba46d0b293790e (diff) |
refactor: remove relying on Rust nightly for better handling of features
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1,6 +1,5 @@ #![cfg_attr(feature = "factory", feature(unboxed_closures, fn_traits))] #![cfg_attr(doc_cfg, feature(doc_cfg))] -#![feature(proc_macro_hygiene)] #![deny(clippy::all)] #![deny(clippy::pedantic)] #![allow(clippy::module_name_repetitions)] @@ -10,23 +9,25 @@ //! //! Syrette is a collection of utilities useful for performing dependency injection. -use feature_macros::feature_specific; - pub mod di_container; pub mod errors; pub mod interfaces; pub mod ptr; -#[feature_specific("async")] +#[cfg(feature = "async")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "async")))] pub mod async_di_container; -#[feature_specific("async")] +#[cfg(feature = "async")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "async")))] pub mod future; -#[feature_specific("async")] +#[cfg(feature = "async")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "async")))] pub use async_di_container::AsyncDIContainer; pub use di_container::DIContainer; -#[feature_specific("factory")] +#[cfg(feature = "factory")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))] pub use syrette_macros::{declare_default_factory, factory}; pub use syrette_macros::{declare_interface, injectable, named}; @@ -122,7 +123,8 @@ macro_rules! di_container_bind { /// }) /// }); /// ``` -#[feature_specific("async")] +#[cfg(feature = "async")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "async")))] #[macro_export] macro_rules! async_closure { (|$($args: ident),*| { $($inner: stmt);* }) => { |