From 2e7b7074ead8cbac2559568f9077ca0123cce537 Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 23 Jun 2024 05:13:18 +0200 Subject: [PATCH] chore: macros under feature, less deps --- apb/Cargo.toml | 4 ++-- apb/src/lib.rs | 5 ++++- apb/src/macros.rs | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apb/Cargo.toml b/apb/Cargo.toml index 831a2af..fee5779 100644 --- a/apb/Cargo.toml +++ b/apb/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apb" -version = "0.2.0" +version = "0.2.1" edition = "2021" authors = [ "alemi " ] description = "Traits and types to handle ActivityPub objects" @@ -20,7 +20,7 @@ paste = "1.0" tracing = "0.1" async-trait = "0.1" serde_json = { version = "1", optional = true } -sea-orm = { version = "0.12", optional = true } +sea-orm = { version = "0.12", optional = true, default-features = false } reqwest = { version = "0.12", features = ["json"], optional = true } [features] diff --git a/apb/src/lib.rs b/apb/src/lib.rs index 691b983..849f2a1 100644 --- a/apb/src/lib.rs +++ b/apb/src/lib.rs @@ -88,7 +88,10 @@ mod macros; -pub(crate) use macros::{strenum, getter, setter}; +pub(crate) use macros::strenum; + +#[cfg(feature = "unstructured")] +pub(crate) use macros::{getter, setter}; mod node; pub use node::Node; diff --git a/apb/src/macros.rs b/apb/src/macros.rs index 28a9af3..cf619e0 100644 --- a/apb/src/macros.rs +++ b/apb/src/macros.rs @@ -114,6 +114,7 @@ macro_rules! strenum { pub(crate) use strenum; +#[cfg(feature = "unstructured")] macro_rules! getter { ($name:ident -> type $t:ty) => { paste::paste! { @@ -208,8 +209,10 @@ macro_rules! getter { }; } +#[cfg(feature = "unstructured")] pub(crate) use getter; +#[cfg(feature = "unstructured")] macro_rules! setter { ($name:ident -> bool) => { paste::item! { @@ -300,6 +303,7 @@ macro_rules! setter { }; } +#[cfg(feature = "unstructured")] pub(crate) use setter; #[cfg(feature = "unstructured")]