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> {
|
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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user