Skip to content

Commit

Permalink
derive default
Browse files Browse the repository at this point in the history
  • Loading branch information
Austionian committed Oct 1, 2023
1 parent e43319b commit 1a742f4
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/frontmatter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use chrono::{DateTime, Utc};
use serde::de::DeserializeOwned;

#[derive(serde::Deserialize, serde::Serialize, Clone, Debug)]
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, Default)]
pub struct FrontMatter {
title: String,
pub date: DateTime<Utc>,
Expand Down Expand Up @@ -53,17 +53,6 @@ draft: {}
}
}

impl Default for FrontMatter {
fn default() -> Self {
Self {
title: String::default(),
date: chrono::Utc::now(),
description: String::default(),
draft: Some(true),
}
}
}

pub fn deserialize_frontmatter<T: DeserializeOwned>(
file_string: &str,
) -> Result<(T, String), FrontmatterError> {
Expand Down

0 comments on commit 1a742f4

Please sign in to comment.