Add field list for regular link.

This commit is contained in:
Tom Alexander 2023-10-06 16:42:31 -04:00
parent e2bc58a469
commit 65df18171a
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -3,6 +3,8 @@ use std::borrow::Cow;
use std::collections::BTreeSet;
use std::collections::HashSet;
use super::compare_field::compare_identity;
use super::compare_field::compare_noop;
use super::compare_field::compare_property_quoted_string;
use super::elisp_fact::ElispFact;
use super::elisp_fact::GetElispFact;
@ -2758,10 +2760,46 @@ fn compare_regular_link<'b, 's>(
emacs: &'b Token<'s>,
rust: &'b RegularLink<'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 :type :path :format :raw-link :application :search-option
if let Some((new_status, new_message)) = compare_properties!(
emacs,
rust,
(
EmacsField::Required(":type"),
compare_identity,
compare_noop
),
(
EmacsField::Required(":path"),
compare_identity,
compare_noop
),
(
EmacsField::Required(":format"),
compare_identity,
compare_noop
),
(
EmacsField::Required(":raw-link"),
compare_identity,
compare_noop
),
(
EmacsField::Required(":application"),
compare_identity,
compare_noop
),
(
EmacsField::Required(":search-option"),
compare_identity,
compare_noop
)
)? {
this_status = new_status;
message = new_message;
}
Ok(DiffResult {
status: this_status,