Avoid closures for the intermediate macro.
This commit is contained in:
@@ -23,13 +23,15 @@ pub(crate) use inoop;
|
||||
///
|
||||
/// This exists to make changing the type signature easier.
|
||||
macro_rules! intermediate {
|
||||
($istruct:ident, $pstruct:ident, $fnbody:expr) => {
|
||||
($istruct:ident, $pstruct:ident, $original:ident, $registry:ident, $fnbody:tt) => {
|
||||
impl $istruct {
|
||||
pub(crate) async fn new<'reg, 'orig, 'parse>(
|
||||
registry: &'reg mut Registry<'orig, 'parse>,
|
||||
original: &'orig organic::types::$pstruct<'parse>,
|
||||
) -> Result<$istruct, CustomError> {
|
||||
$fnbody(registry, original).await
|
||||
let $original = original;
|
||||
let $registry = registry;
|
||||
$fnbody
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user