From 97c789e38bb8e61389a3808d241689e623144344 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 3 Oct 2022 20:23:26 +0200 Subject: refactor: remove relying on Rust nightly for better handling of features --- src/lib.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 2cd2f03..a462c21 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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);* }) => { -- cgit v1.2.3-18-g5258