Switch to more generic implementation.

This commit is contained in:
Tom Alexander
2023-10-06 16:03:41 -04:00
parent 3da52a0826
commit c7dbe596b3
3 changed files with 11 additions and 33 deletions

View File

@@ -1,6 +1,6 @@
/// Create iterators for ast nodes where it only has to iterate over children
macro_rules! compare_properties {
($emacs:expr, $($emacs_field:expr, $rust_value:expr, $compare_fn: ident),+) => {
($emacs:expr, $rust:expr, $($emacs_field:expr, $rust_value_getter:expr, $compare_fn: ident),+) => {
{
let mut this_status = DiffStatus::Good;
let mut message: Option<String> = None;
@@ -57,7 +57,7 @@ macro_rules! compare_properties {
name
},
};
let result = $compare_fn($emacs, emacs_name, $rust_value)?;
let result = $compare_fn($emacs, $rust, emacs_name, $rust_value_getter)?;
match result {
Some((DiffStatus::Good, _)) => unreachable!("No comparison functions should return Some() when DiffStatus is good."),
Some((status, msg)) => {