From 6e6678b0e4f07abb9a413e4052c417697d198164 Mon Sep 17 00:00:00 2001 From: Al Liu Date: Fri, 6 Oct 2023 01:33:12 +0800 Subject: [PATCH] Add derive feature (#22) * chore: remove unused PhantomData * add derive feature --- overwatch-rs/Cargo.toml | 6 +++++- overwatch-rs/src/lib.rs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/overwatch-rs/Cargo.toml b/overwatch-rs/Cargo.toml index 696afc7..49eb858 100644 --- a/overwatch-rs/Cargo.toml +++ b/overwatch-rs/Cargo.toml @@ -18,9 +18,12 @@ exclude = [ ] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["derive"] +derive = ["dep:overwatch-derive"] [dependencies] -overwatch-derive = { path = "../overwatch-derive" } +overwatch-derive = { path = "../overwatch-derive", optional = true } const-str = "0.3" color-eyre = "0.6" async-trait = "0.1" @@ -33,3 +36,4 @@ tracing = "0.1" [dev-dependencies] tokio = { version = "1.17", features = ["rt-multi-thread", "sync", "time", "io-std", "io-util", "macros"] } +overwatch-derive = { path = "../overwatch-derive" } \ No newline at end of file diff --git a/overwatch-rs/src/lib.rs b/overwatch-rs/src/lib.rs index c19ceaf..debaf9a 100644 --- a/overwatch-rs/src/lib.rs +++ b/overwatch-rs/src/lib.rs @@ -29,3 +29,6 @@ pub mod services; pub mod utils; pub type DynError = Box; + +#[cfg(feature = "derive")] +pub use overwatch_derive::*;