Fix finding name keyword in affiliated keywords list.

This commit is contained in:
Tom Alexander 2023-10-04 21:32:10 -04:00
parent 93fe46e4e7
commit b82d4c0eca
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -280,10 +280,7 @@ pub(crate) fn indentation_level<'b, 'g, 'r, 's>(
pub(crate) fn get_name<'s>(affiliated_keywords: &Vec<Keyword<'s>>) -> Option<&'s str> { pub(crate) fn get_name<'s>(affiliated_keywords: &Vec<Keyword<'s>>) -> Option<&'s str> {
let name_keyword = affiliated_keywords let name_keyword = affiliated_keywords
.iter() .iter()
.filter(|kw| match kw.name { .filter(|kw| kw.key.eq_ignore_ascii_case("name"))
Some(name) if name.eq_ignore_ascii_case("name") => true,
_ => false,
})
.last(); .last();
name_keyword.map(|kw| kw.value) name_keyword.map(|kw| kw.value)
} }