Fix clippy issues.
This commit is contained in:
@@ -55,11 +55,10 @@ impl BlogPost {
|
||||
// Assign IDs to the targets
|
||||
organic::types::AstNode::from(parsed_document)
|
||||
.iter_all_ast_nodes()
|
||||
.for_each(|node| match node {
|
||||
organic::types::AstNode::Target(target) => {
|
||||
.for_each(|node| {
|
||||
if let organic::types::AstNode::Target(target) = node {
|
||||
registry.get_target(target.value);
|
||||
}
|
||||
_ => {}
|
||||
});
|
||||
|
||||
let registry = Arc::new(Mutex::new(registry));
|
||||
@@ -96,15 +95,14 @@ impl BlogPost {
|
||||
pub(crate) fn get_date(&self) -> Option<&str> {
|
||||
let index_page_date = self
|
||||
.get_index_page()
|
||||
.map(|index_page| index_page.date.as_ref().map(String::as_str))
|
||||
.flatten();
|
||||
.and_then(|index_page| index_page.date.as_deref());
|
||||
if index_page_date.is_some() {
|
||||
return index_page_date;
|
||||
}
|
||||
|
||||
self.pages
|
||||
.iter()
|
||||
.filter_map(|page| page.date.as_ref().map(String::as_str))
|
||||
.filter_map(|page| page.date.as_deref())
|
||||
.next()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user