diff --git a/src/fmt.rs b/src/fmt.rs index 14f8a16..f42b4de 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -8,17 +8,14 @@ use strum::{Display, EnumString}; pub use self::{json_writer::JsonWriter, md_writer::MarkdownWriter}; use crate::{clog::Clog, error::Result, sectionmap::SectionMap}; -#[derive(Copy, Clone, PartialEq, Eq, Debug, EnumString, Display)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, EnumString, Display)] #[strum(ascii_case_insensitive)] pub enum ChangelogFormat { Json, + #[default] Markdown, } -impl Default for ChangelogFormat { - fn default() -> Self { ChangelogFormat::Markdown } -} - impl<'de> serde::de::Deserialize<'de> for ChangelogFormat { fn deserialize(deserializer: D) -> StdResult where diff --git a/src/link_style.rs b/src/link_style.rs index c7e3f15..13b05ab 100644 --- a/src/link_style.rs +++ b/src/link_style.rs @@ -12,19 +12,16 @@ use strum::{Display, EnumString}; /// let clog = Clog::new().unwrap(); /// clog.link_style(LinkStyle::Stash); /// ``` -#[derive(Debug, Copy, Clone, PartialEq, Eq, Display, EnumString)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Default, Display, EnumString)] #[strum(ascii_case_insensitive)] pub enum LinkStyle { + #[default] Github, Gitlab, Stash, Cgit, } -impl Default for LinkStyle { - fn default() -> Self { LinkStyle::Github } -} - impl<'de> serde::de::Deserialize<'de> for LinkStyle { fn deserialize(deserializer: D) -> Result where