Fix comparing key and mark prefix/suffix as optional.
This commit is contained in:
@@ -14,7 +14,6 @@ use crate::types::AstNode;
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum EmacsField<'s> {
|
||||
Required(&'s str),
|
||||
#[allow(dead_code)]
|
||||
Optional(&'s str),
|
||||
}
|
||||
|
||||
|
||||
@@ -3492,13 +3492,21 @@ fn compare_citation<'b, 's>(
|
||||
compare_property_quoted_string
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":prefix"),
|
||||
|r| Some(r.prefix.iter()),
|
||||
EmacsField::Optional(":prefix"),
|
||||
|r| if r.prefix.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(r.prefix.iter())
|
||||
},
|
||||
compare_property_list_of_ast_nodes
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":suffix"),
|
||||
|r| Some(r.suffix.iter()),
|
||||
EmacsField::Optional(":suffix"),
|
||||
|r| if r.suffix.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(r.suffix.iter())
|
||||
},
|
||||
compare_property_list_of_ast_nodes
|
||||
)
|
||||
) {
|
||||
@@ -3544,13 +3552,21 @@ fn compare_citation_reference<'b, 's>(
|
||||
compare_property_quoted_string
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":prefix"),
|
||||
|r| Some(r.prefix.iter()),
|
||||
EmacsField::Optional(":prefix"),
|
||||
|r| if r.prefix.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(r.prefix.iter())
|
||||
},
|
||||
compare_property_list_of_ast_nodes
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":suffix"),
|
||||
|r| Some(r.suffix.iter()),
|
||||
EmacsField::Optional(":suffix"),
|
||||
|r| if r.suffix.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(r.suffix.iter())
|
||||
},
|
||||
compare_property_list_of_ast_nodes
|
||||
)
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user