Add compare for document category.

This commit is contained in:
Tom Alexander 2023-12-27 16:34:04 -05:00
parent d38100581c
commit badeaf8246
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 6 additions and 1 deletions

View File

@ -18,7 +18,7 @@ pub struct WasmDocument<'s, 'p> {
standard_properties: WasmStandardProperties,
additional_properties: Vec<(String, &'s str)>,
pub(crate) children: Vec<WasmAstNode<'s, 'p>>,
category: Option<&'p str>,
pub(crate) category: Option<&'p str>,
pub(crate) path: Option<PathBuf>,
}

View File

@ -247,6 +247,11 @@ impl<'s, 'p> WasmElispCompare<'s, 'p> for WasmDocument<'s, 'p> {
EmacsField::Required(":path"),
|w| w.path.as_ref().and_then(|p| p.to_str()),
wasm_compare_property_quoted_string
),
(
EmacsField::Required(":CATEGORY"),
|w| w.category.as_ref(),
wasm_compare_property_quoted_string
)
);
Ok(result)