Remove the GetStandardProperties trait.

This was using dynamic dispatch to deal with enums to avoid the repetitive typing.
This commit is contained in:
Tom Alexander
2023-10-31 21:20:39 -04:00
parent 49f6e70a19
commit bcf1b49db2
14 changed files with 159 additions and 218 deletions

View File

@@ -15,7 +15,6 @@ use crate::compare::sexp::unquote;
use crate::types::AffiliatedKeywordValue;
use crate::types::AstNode;
use crate::types::GetAffiliatedKeywords;
use crate::types::GetStandardProperties;
use crate::types::StandardProperties;
/// Check if the child string slice is a slice of the parent string slice.
@@ -44,14 +43,14 @@ fn get_rust_byte_offsets<'b, 's, S: StandardProperties<'s> + ?Sized>(
pub(crate) fn compare_standard_properties<
'b,
's,
S: GetStandardProperties<'s> + GetElispFact<'s> + ?Sized,
S: StandardProperties<'s> + GetElispFact<'s> + ?Sized,
>(
original_document: &'s str,
emacs: &'b Token<'s>,
rust: &'b S,
) -> Result<(), Box<dyn std::error::Error>> {
assert_name(emacs, rust.get_elisp_fact().get_elisp_name())?;
assert_bounds(original_document, emacs, rust.get_standard_properties())?;
assert_bounds(original_document, emacs, rust)?;
Ok(())
}