Fix clippy issues.
All checks were successful
rust-test Build rust-test has succeeded
rust-clippy Build rust-clippy has succeeded
build-natter Build build-natter has succeeded
format Build format has succeeded

This commit is contained in:
Tom Alexander
2023-12-23 06:38:23 -05:00
parent 818fca87f2
commit 397d4ea0bc
20 changed files with 42 additions and 73 deletions

View File

@@ -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()
}