diff --git a/crates/macros/src/constant.rs b/crates/macros/src/constant.rs index 3a9516c26..ebc4bf1c2 100644 --- a/crates/macros/src/constant.rs +++ b/crates/macros/src/constant.rs @@ -15,6 +15,13 @@ pub struct Constant { pub value: String, } +fn prepare(input: ItemConst) -> Result { + Ok(quote! { + #[allow(dead_code)] + #input + }) +} + pub fn parser(input: ItemConst) -> Result { let mut state = STATE.lock(); @@ -28,10 +35,7 @@ pub fn parser(input: ItemConst) -> Result { value: input.expr.to_token_stream().to_string(), }); - Ok(quote! { - #[allow(dead_code)] - #input - }) + prepare(input) } impl Constant {