Comparing single string values.
This commit is contained in:
@@ -20,12 +20,12 @@ pub(crate) fn parse_affiliated_keywords<'g, 's>(
|
||||
let mut ret = BTreeMap::new();
|
||||
for kw in input.into_iter() {
|
||||
let translated_name = translate_name(global_settings, kw.key);
|
||||
if is_single_string_keyword(global_settings, translated_name) {
|
||||
if is_single_string_keyword(global_settings, translated_name.as_str()) {
|
||||
ret.insert(
|
||||
translated_name,
|
||||
AffiliatedKeywordValue::SingleString(kw.value),
|
||||
);
|
||||
} else if is_list_of_objects_keyword(global_settings, translated_name) {
|
||||
} else if is_list_of_objects_keyword(global_settings, translated_name.as_str()) {
|
||||
let initial_context = ContextElement::document_context();
|
||||
let initial_context = Context::new(global_settings, List::new(&initial_context));
|
||||
|
||||
@@ -58,13 +58,13 @@ pub(crate) fn parse_affiliated_keywords<'g, 's>(
|
||||
AffiliatedKeywords { keywords: ret }
|
||||
}
|
||||
|
||||
fn translate_name<'g, 's>(global_settings: &'g GlobalSettings<'g, 's>, name: &'s str) -> &'s str {
|
||||
fn translate_name<'g, 's>(global_settings: &'g GlobalSettings<'g, 's>, name: &'s str) -> String {
|
||||
for (src, dst) in global_settings.element_keyword_translation_alist {
|
||||
if name.eq_ignore_ascii_case(src) {
|
||||
return *dst;
|
||||
return dst.to_lowercase();
|
||||
}
|
||||
}
|
||||
name
|
||||
name.to_lowercase()
|
||||
}
|
||||
|
||||
fn is_single_string_keyword<'g, 's>(
|
||||
|
||||
Reference in New Issue
Block a user