Support a no-op for headline pre-blank.
Some checks failed
clippy Build clippy has failed
rust-build Build rust-build has failed
rust-foreign-document-test Build rust-foreign-document-test has succeeded
rust-test Build rust-test has failed

This commit is contained in:
Tom Alexander
2023-12-29 23:21:30 -05:00
parent c1b471208d
commit dd1f7c7777
3 changed files with 25 additions and 5 deletions

View File

@@ -37,9 +37,13 @@ pub struct WasmHeadline {
pub(crate) deadline: Option<Box<WasmAstNode>>,
pub(crate) closed: Option<Box<WasmAstNode>>,
#[serde(rename = "pre-blank")]
pub(crate) pre_blank: usize,
pub(crate) pre_blank: Noop,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "noop")]
pub struct Noop {}
to_wasm!(
WasmHeadline,
Heading<'s>,
@@ -129,7 +133,7 @@ to_wasm!(
})
.map_or(Ok(None), |r| r.map(Some))?
.map(|child| Box::new(child)),
pre_blank: 0, // TODO: Should this be a no-op?
pre_blank: Noop {},
},
))
}

View File

@@ -8,6 +8,7 @@ use crate::compare::ElispFact;
use crate::types::CheckboxType;
use crate::types::PlainListItem;
use crate::types::PlainListItemCounter;
use crate::types::PlainListItemPreBlank;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
@@ -17,7 +18,7 @@ pub struct WasmPlainListItem {
pub(crate) counter: Option<PlainListItemCounter>,
pub(crate) checkbox: Option<String>,
#[serde(rename = "pre-blank")]
pub(crate) pre_blank: usize,
pub(crate) pre_blank: PlainListItemPreBlank,
}
to_wasm!(
@@ -52,7 +53,7 @@ to_wasm!(
}
.to_owned()
}),
pre_blank: 0, // TODO: Should this be a no-op?
pre_blank: original.pre_blank,
},
))
}