Apply more suggestions.
This commit is contained in:
@@ -19,7 +19,7 @@ pub struct AffiliatedKeyword<'s> {
|
||||
pub value: AffiliatedKeywordValue<'s>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Default)]
|
||||
pub struct AffiliatedKeywords<'s> {
|
||||
pub(crate) keywords: BTreeMap<String, AffiliatedKeywordValue<'s>>,
|
||||
}
|
||||
@@ -27,11 +27,3 @@ pub struct AffiliatedKeywords<'s> {
|
||||
pub trait GetAffiliatedKeywords<'s> {
|
||||
fn get_affiliated_keywords<'a>(&'a self) -> &'a AffiliatedKeywords<'s>;
|
||||
}
|
||||
|
||||
impl<'s> Default for AffiliatedKeywords<'s> {
|
||||
fn default() -> Self {
|
||||
AffiliatedKeywords {
|
||||
keywords: BTreeMap::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,9 +101,8 @@ impl<'s> Heading<'s> {
|
||||
_ => None,
|
||||
})
|
||||
.flat_map(|section| section.children.iter())
|
||||
.take_while(|element| match element {
|
||||
Element::Planning(_) | Element::PropertyDrawer(_) => true,
|
||||
_ => false,
|
||||
.take_while(|element| {
|
||||
matches!(element, Element::Planning(_) | Element::PropertyDrawer(_))
|
||||
})
|
||||
.find_map(|element| match element {
|
||||
Element::PropertyDrawer(property_drawer) => Some(property_drawer),
|
||||
@@ -121,10 +120,8 @@ impl<'s> Document<'s> {
|
||||
.iter()
|
||||
.flat_map(|zeroth_section| zeroth_section.children.iter());
|
||||
let property_drawer = zeroth_section_children
|
||||
.take_while(|element| match element {
|
||||
Element::Comment(_) => true,
|
||||
Element::PropertyDrawer(_) => true,
|
||||
_ => false,
|
||||
.take_while(|element| {
|
||||
matches!(element, Element::Comment(_) | Element::PropertyDrawer(_))
|
||||
})
|
||||
.find_map(|element| match element {
|
||||
Element::PropertyDrawer(property_drawer) => Some(property_drawer),
|
||||
|
||||
Reference in New Issue
Block a user