Fix finding name keyword in affiliated keywords list.
This commit is contained in:
parent
93fe46e4e7
commit
b82d4c0eca
@ -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> {
|
||||
let name_keyword = affiliated_keywords
|
||||
.iter()
|
||||
.filter(|kw| match kw.name {
|
||||
Some(name) if name.eq_ignore_ascii_case("name") => true,
|
||||
_ => false,
|
||||
})
|
||||
.filter(|kw| kw.key.eq_ignore_ascii_case("name"))
|
||||
.last();
|
||||
name_keyword.map(|kw| kw.value)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user