Standardize the construction of intermediate BlogPostPage.

This commit is contained in:
Tom Alexander
2023-12-19 17:09:11 -05:00
parent 261fe8a1a2
commit 4bb1f9983a
27 changed files with 405 additions and 248 deletions

View File

@@ -23,14 +23,12 @@ pub(crate) use inoop;
///
/// This exists to make changing the type signature easier.
macro_rules! intermediate {
($istruct:ident, $pstruct:ident, $original:ident, $registry:ident, $fnbody:tt) => {
($istruct:ident, $pstruct:ty, $original:ident, $registry:ident, $fnbody:tt) => {
impl $istruct {
pub(crate) async fn new<'orig, 'parse>(
registry: crate::intermediate::RefRegistry<'orig, 'parse>,
original: &'orig organic::types::$pstruct<'parse>,
$registry: crate::intermediate::RefRegistry<'orig, 'parse>,
$original: $pstruct,
) -> Result<$istruct, CustomError> {
let $original = original;
let $registry = registry;
$fnbody
}
}