1
0
Fork 0

cargo clippy --fix && cargo fmt

This commit is contained in:
Adrian Hedqvist 2023-06-18 11:46:49 +02:00
parent 78eea37b94
commit 69680f227c
2 changed files with 6 additions and 7 deletions

View file

@ -19,8 +19,7 @@ pub fn render_markdown_to_html(markdown: &str) -> Result<String> {
Event::Text(text) => {
if code_block {
code_accumulator.push_str(&text);
}
else {
} else {
events.push(Event::Text(text));
}
}

View file

@ -4,14 +4,14 @@ use chrono::{DateTime, FixedOffset};
use glob::glob;
use lazy_static::lazy_static;
use pulldown_cmark::{html, Options, Parser};
use regex::Regex;
use serde_derive::{Deserialize, Serialize};
use tokio::fs;
use tracing::{instrument, log::*};
use crate::{AppState, WebsiteError, markdown};
use crate::{markdown, AppState, WebsiteError};
#[derive(Deserialize, Debug, Default)]
pub struct TomlFrontMatter {
@ -102,9 +102,9 @@ pub async fn load_post(slug: &str) -> color_eyre::eyre::Result<Post> {
let (tomlfm, content) = parse_frontmatter(content)?;
let tomlfm = tomlfm.expect("Missing frontmatter");
let content = content.map(|c| {
markdown::render_markdown_to_html(&c)
}).transpose()?;
let content = content
.map(|c| markdown::render_markdown_to_html(&c))
.transpose()?;
Ok(Post::new(
slug.to_string(),