From 517cc97f1df68e52635d88c20127646f8b9c39ea Mon Sep 17 00:00:00 2001 From: Kevin K Date: Mon, 8 Jul 2024 19:02:16 -0400 Subject: [PATCH 1/4] style: clippy --- src/sectionmap.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/sectionmap.rs b/src/sectionmap.rs index 7380439..a12e050 100644 --- a/src/sectionmap.rs +++ b/src/sectionmap.rs @@ -46,15 +46,12 @@ impl SectionMap { let comp_map = sm .sections .entry("Breaking Changes".to_owned()) - .or_insert(BTreeMap::new()); - let sec_map = comp_map.entry(entry.component.clone()).or_insert(vec![]); + .or_default(); + let sec_map = comp_map.entry(entry.component.clone()).or_default(); sec_map.push(entry.clone()); } - let comp_map = sm - .sections - .entry(entry.commit_type.clone()) - .or_insert(BTreeMap::new()); - let sec_map = comp_map.entry(entry.component.clone()).or_insert(vec![]); + let comp_map = sm.sections.entry(entry.commit_type.clone()).or_default(); + let sec_map = comp_map.entry(entry.component.clone()).or_default(); sec_map.push(entry); } From 7b31274c477077f47ad53dfa96363b21f219db40 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Mon, 8 Jul 2024 19:04:28 -0400 Subject: [PATCH 2/4] chore: increase version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9ebccd0..bee0c99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ keywords = ["git", "log", "changelog", "parser", "parse"] license = "MIT" name = "clog" edition = "2021" -version = "0.10.0" +version = "0.10.1" rust-version = "1.58.1" # MSRV authors = ["Christoph Burgdorf "] description = "A conventional changelog for the rest of us" From e86334920c4568eac4765ef767674b00aa40e7d3 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Mon, 8 Jul 2024 19:13:12 -0400 Subject: [PATCH 3/4] break: bump MSRV to 1.67.1 --- .github/workflows/ci.yml | 2 +- Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4534998..3feaf31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: rust: - stable - nightly - - 1.58.1 # MSRV + - 1.67.1 # MSRV steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index bee0c99..007651d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,8 +5,8 @@ keywords = ["git", "log", "changelog", "parser", "parse"] license = "MIT" name = "clog" edition = "2021" -version = "0.10.1" -rust-version = "1.58.1" # MSRV +version = "0.11.0" +rust-version = "1.67.1" # MSRV authors = ["Christoph Burgdorf "] description = "A conventional changelog for the rest of us" exclude = ["docs/*"] From 959b873ce2e3a36c4ae9e4115ae8586f34c376ac Mon Sep 17 00:00:00 2001 From: Kevin K Date: Mon, 8 Jul 2024 19:18:31 -0400 Subject: [PATCH 4/4] style: clippy --- src/fmt.rs | 7 ++----- src/link_style.rs | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) 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