diff --git a/Cargo.toml b/Cargo.toml index 1e187eb..a27e9aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["cling", "cling-derive"] [workspace.package] -version = "0.1.0" +version = "0.1.1" edition = "2021" authors = ["Ahmed Farghal "] license = "Apache-2.0 OR MIT" diff --git a/cling-derive/src/lib.rs b/cling-derive/src/lib.rs index 43714b2..db76447 100644 --- a/cling-derive/src/lib.rs +++ b/cling-derive/src/lib.rs @@ -2,11 +2,12 @@ //! Do not depend on this library directly. Instead, use `cling` mod attributes; +#[cfg(debug_assertions)] mod cling_handler; mod derives; use proc_macro::TokenStream; -use syn::{parse_macro_input, DeriveInput, ItemFn}; +use syn::{parse_macro_input, DeriveInput}; #[proc_macro_derive(Run, attributes(cling, command, clap))] pub fn derive_run(input: TokenStream) -> TokenStream { @@ -23,10 +24,11 @@ pub fn derive_collect(input: TokenStream) -> TokenStream { #[proc_macro_attribute] pub fn cling_handler(_attr: TokenStream, function: TokenStream) -> TokenStream { #[cfg(not(debug_assertions))] - return input; + return function; #[cfg(debug_assertions)] { + use syn::ItemFn; let input = parse_macro_input!(function as ItemFn); cling_handler::expand_handler(&input).into() }