From 758dfcea5b0116eed6b3c0f643e2672a15022e5f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Nov 2024 17:50:32 +0100 Subject: [PATCH] use default --- src/utils/metadata.rs | 2 +- src/utils/misc.rs | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/utils/metadata.rs b/src/utils/metadata.rs index d287bc2..08d075e 100644 --- a/src/utils/metadata.rs +++ b/src/utils/metadata.rs @@ -93,7 +93,7 @@ pub struct MFile { #[allow(clippy::struct_excessive_bools)] /// Global metadata -#[derive(Content, Debug, Clone)] +#[derive(Content, Debug, Clone, Default)] pub struct Metadata { pub info: MFile, pub math: bool, diff --git a/src/utils/misc.rs b/src/utils/misc.rs index bbebd0b..834d565 100644 --- a/src/utils/misc.rs +++ b/src/utils/misc.rs @@ -13,7 +13,7 @@ use crate::config::FileConfiguration; use super::{ markdown::{read_md, File}, - metadata::{MFile, MType, Metadata}, + metadata::{MType, Metadata}, }; #[cached] @@ -72,13 +72,7 @@ fn read_pdf(data: Vec) -> File { let pdf = general_purpose::STANDARD.encode(data); File { - metadata: Metadata { - info: MFile::default(), - mermaid: false, - syntax_highlight: false, - math: false, - mail_obfsucated: false, - }, + metadata: Metadata::default(), content: format!( r#"