Create a template for new element functions that will take in the affiliated keywords instead of re-parsing them multiple times.
This commit is contained in:
@@ -25,12 +25,15 @@ use crate::types::AffiliatedKeywordValue;
|
||||
use crate::types::AffiliatedKeywords;
|
||||
use crate::types::Keyword;
|
||||
|
||||
pub(crate) fn parse_affiliated_keywords<'g, 's>(
|
||||
pub(crate) fn parse_affiliated_keywords<'g, 's, AK>(
|
||||
global_settings: &'g GlobalSettings<'g, 's>,
|
||||
input: Vec<Keyword<'s>>,
|
||||
) -> AffiliatedKeywords<'s> {
|
||||
input: AK,
|
||||
) -> AffiliatedKeywords<'s>
|
||||
where
|
||||
AK: IntoIterator<Item = Keyword<'s>>,
|
||||
{
|
||||
let mut ret = BTreeMap::new();
|
||||
for kw in input.into_iter() {
|
||||
for kw in input {
|
||||
let translated_name = translate_name(global_settings, kw.key);
|
||||
if is_single_string_keyword(global_settings, translated_name.as_str()) {
|
||||
ret.insert(
|
||||
|
||||
Reference in New Issue
Block a user