Add a lifetime for data in the parsed result but not from the source.

This commit is contained in:
Tom Alexander
2023-12-27 11:36:47 -05:00
parent abf066701e
commit 1a70b3d2c0
63 changed files with 276 additions and 309 deletions

View File

@@ -1,25 +1,25 @@
use std::marker::PhantomData;
use crate::types::Heading;
use serde::Serialize;
use super::ast_node::WasmAstNode;
use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm;
use crate::types::Heading;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize)]
#[serde(tag = "ast_node")]
#[serde(rename = "headline")]
pub(crate) struct WasmHeadline<'s> {
pub(crate) struct WasmHeadline<'s, 'p> {
standard_properties: WasmStandardProperties,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
}
to_wasm!(
WasmHeadline<'s>,
WasmHeadline<'s, 'p>,
Heading<'s>,
original,
wasm_context,
@@ -33,8 +33,8 @@ to_wasm!(
}
);
impl<'s> Into<WasmAstNode<'s>> for WasmHeadline<'s> {
fn into(self) -> WasmAstNode<'s> {
impl<'s, 'p> Into<WasmAstNode<'s, 'p>> for WasmHeadline<'s, 'p> {
fn into(self) -> WasmAstNode<'s, 'p> {
WasmAstNode::Headline(self)
}
}