Minor tweak in this awful pile of code
Some checks failed
Build library & run tests / build (tcp) (push) Successful in 51s
Build library & run tests / build (unix) (push) Failing after 54s

This commit is contained in:
Kodi Craft 2024-06-24 15:36:29 +02:00
parent 62262cb0fe
commit cd2cf3346f
Signed by: kodi
GPG Key ID: 69D9EED60B242822

View File

@ -37,21 +37,29 @@ fn derive_protocol(input: proc_macro2::TokenStream) -> proc_macro2::TokenStream
// TODO: These logs should be filterable in some way
#[cfg(feature = "log")]
#[allow(unused_variables)]
let debug = quote! { log::debug! };
#[cfg(feature = "log")]
#[allow(unused_variables)]
let info = quote! { log::info! };
#[cfg(feature = "log")]
let _warn = quote! { log::warn! };
#[allow(unused_variables)]
let warn = quote! { log::warn! };
#[cfg(feature = "log")]
let _error = quote! { log::error! };
#[allow(unused_variables)]
let error = quote! { log::error! };
#[cfg(not(feature = "log"))]
#[allow(unused_variables)]
let debug = quote! { eprintln! };
#[cfg(not(feature = "log"))]
#[allow(unused_variables)]
let info = quote! { eprintln! };
#[cfg(not(feature = "log"))]
let _warn = quote! { eprintln! };
#[allow(unused_variables)]
let warn = quote! { eprintln! };
#[cfg(not(feature = "log"))]
let _error = quote! { eprintln! };
#[allow(unused_variables)]
let error = quote! { eprintln! };
// Must be on an enum
let enum_ = match &input.data {