Remove deserialize to support borrows.

This commit is contained in:
Tom Alexander
2023-12-25 12:42:38 -05:00
parent eb51bdfe2f
commit 995b41e697
61 changed files with 72 additions and 68 deletions

View File

@@ -1,7 +1,4 @@
use std::marker::PhantomData;
use organic::types::Document;
use serde::Deserialize;
use serde::Serialize;
use super::ast_node::WasmAstNode;
@@ -10,14 +7,13 @@ use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize)]
#[serde(tag = "ast_node")]
#[serde(rename = "org-data")]
pub(crate) struct WasmDocument<'s> {
standard_properties: WasmStandardProperties,
additional_properties: Vec<(String, String)>,
children: Vec<()>,
phantom: PhantomData<&'s ()>,
additional_properties: Vec<(String, &'s str)>,
children: Vec<WasmAstNode<'s>>,
}
to_wasm!(
@@ -37,11 +33,16 @@ to_wasm!(
})
.collect();
// let children = original
// .children
// .iter()
// .map(|child| child.to_wasm(wasm_context.clone()))
// .collect::<Result<Vec<_>, _>>()?;
Ok(WasmDocument {
standard_properties,
additional_properties: Vec::new(),
additional_properties,
children: Vec::new(),
phantom: PhantomData,
})
}
);