diff --git a/rust/macros/helpers.rs b/rust/macros/helpers.rs index 8b5f9bc414d7ae..5ae30b52d8b2fe 100644 --- a/rust/macros/helpers.rs +++ b/rust/macros/helpers.rs @@ -2,6 +2,8 @@ use proc_macro::{token_stream, Group, TokenTree}; +pub(crate) type FnTrySimpleParam = Box Option>; + pub(crate) fn try_ident(it: &mut token_stream::IntoIter) -> Option { if let Some(TokenTree::Ident(ident)) = it.next() { Some(ident.to_string()) diff --git a/rust/macros/module.rs b/rust/macros/module.rs index 6001fd692469be..1fc532061a69d3 100644 --- a/rust/macros/module.rs +++ b/rust/macros/module.rs @@ -145,7 +145,7 @@ fn param_ops_path(param_type: &str) -> &'static str { fn try_simple_param_val( param_type: &str, -) -> Box Option> { +) -> FnTrySimpleParam { match param_type { "bool" => Box::new(try_ident), "str" => Box::new(|param_it| {