You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
organic/src/wasm/strike_through.rs

35 lines
852 B
Rust

use serde::Deserialize;
use serde::Serialize;
use super::ast_node::WasmAstNode;
use super::macros::to_wasm;
use super::to_wasm::ToWasm;
use crate::types::StrikeThrough;
use crate::util::elisp_fact::ElispFact;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
pub struct WasmStrikeThrough {}
to_wasm!(
WasmStrikeThrough,
StrikeThrough<'s>,
original,
wasm_context,
{ WasmAstNode::StrikeThrough(original) },
{ "strike-through".into() },
{
let children = original
.children
.iter()
.map(|child| {
child
.to_wasm(wasm_context.clone())
.map(Into::<WasmAstNode>::into)
})
.collect::<Result<Vec<_>, _>>()?;
Ok((children, WasmStrikeThrough {}))
}
);