aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-08-01 17:44:02 +0200
committerHampusM <hampus@hampusmat.com>2022-08-01 17:44:02 +0200
commiteeef21b0b78aa7970e0ab93f37b3b6bba5391426 (patch)
tree26450c6d88b9831d619bfc0a8ecf7d43cef3ed91
parent3383faeaf8342cf4637b6d9a9dfba30b1684edca (diff)
refactor: limit the factory macro to the factory feature
-rw-r--r--Cargo.toml2
-rw-r--r--macros/Cargo.toml6
-rw-r--r--macros/src/lib.rs1
3 files changed, 8 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 2874d19..3f000af 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@ edition = "2021"
all-features = true
[features]
-factory = []
+factory = ["syrette_macros/factory"]
[[example]]
name = "factory"
diff --git a/macros/Cargo.toml b/macros/Cargo.toml
index 84bd948..6ac624a 100644
--- a/macros/Cargo.toml
+++ b/macros/Cargo.toml
@@ -11,6 +11,12 @@ edition = "2021"
[lib]
proc_macro = true
+[package.metadata.docs.rs]
+all-features = true
+
+[features]
+factory = []
+
[dependencies]
syn = { version = "1.0.96", features = ["full"] }
quote = "1.0.18"
diff --git a/macros/src/lib.rs b/macros/src/lib.rs
index 7dba7d1..86db787 100644
--- a/macros/src/lib.rs
+++ b/macros/src/lib.rs
@@ -144,6 +144,7 @@ pub fn injectable(args_stream: TokenStream, impl_stream: TokenStream) -> TokenSt
/// type IConfiguratorFactory = dyn IFactory<(Vec<String>,), dyn IConfigurator>;
/// ```
#[proc_macro_attribute]
+#[cfg(feature = "factory")]
pub fn factory(_: TokenStream, type_alias_stream: TokenStream) -> TokenStream
{
let factory_type_alias::FactoryTypeAlias {