Populate standard properties.
This commit is contained in:
@@ -2,10 +2,15 @@
|
||||
///
|
||||
/// This exists to make changing the type signature easier.
|
||||
macro_rules! to_wasm {
|
||||
($ostruct:ty, $istruct:ty, $original:ident, $document:ident, $fnbody:tt) => {
|
||||
impl<'s> From<(&'s str, $istruct)> for $ostruct {
|
||||
fn from(value: (&'s str, $istruct)) -> $ostruct {
|
||||
let ($original, $document) = value;
|
||||
($ostruct:ty, $istruct:ty, $wasm_context:ident, $standard_properties:ident, $fnbody:tt) => {
|
||||
impl<'s> ToWasm for $istruct {
|
||||
type Output = $ostruct;
|
||||
|
||||
fn to_wasm(
|
||||
&self,
|
||||
$wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>,
|
||||
) -> Result<Self::Output, crate::error::CustomError> {
|
||||
let $standard_properties = self.to_wasm_standard_properties($wasm_context)?;
|
||||
$fnbody
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user