Compare properties for export snippets.

This commit is contained in:
Tom Alexander 2023-10-09 12:34:21 -04:00
parent 8dde8ce4e1
commit 00ed63dcaa
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -3217,10 +3217,26 @@ fn compare_export_snippet<'b, 's>(
emacs: &'b Token<'s>,
rust: &'b ExportSnippet<'s>,
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
let this_status = DiffStatus::Good;
let message = None;
let mut this_status = DiffStatus::Good;
let mut message = None;
// TODO: Compare :back-end :value
if let Some((new_status, new_message)) = compare_properties!(
emacs,
rust,
(
EmacsField::Required(":back-end"),
|r| Some(r.backend),
compare_property_quoted_string
),
(
EmacsField::Required(":value"),
|r| r.contents,
compare_property_quoted_string
)
)? {
this_status = new_status;
message = new_message;
}
Ok(DiffResult {
status: this_status,