Compare the additional properties on headlines.

This commit is contained in:
Tom Alexander
2023-10-10 17:40:27 -04:00
parent 6b90a9bfa8
commit 7cb71a5a0a
3 changed files with 63 additions and 1 deletions

View File

@@ -32,6 +32,26 @@ pub(crate) enum ComparePropertiesResult<'b, 's> {
DiffEntry(DiffEntry<'b, 's>),
}
impl<'b, 's> ComparePropertiesResult<'b, 's> {
pub(crate) fn apply(
self,
child_status: &mut Vec<DiffEntry<'b, 's>>,
this_status: &mut DiffStatus,
message: &mut Option<String>,
) {
match self {
ComparePropertiesResult::NoChange => {}
ComparePropertiesResult::SelfChange(new_status, new_message) => {
*this_status = new_status;
*message = new_message
}
ComparePropertiesResult::DiffEntry(diff_entry) => child_status.push(diff_entry),
}
// foo
}
}
/// Do no comparison.
///
/// This is for when you want to acknowledge that a field exists in the emacs token, but you do not have any validation for it when using the compare_properties!() macro. Ideally, this should be kept to a minimum since this represents untested values.