Skip to content

Commit

Permalink
Merge pull request #28 from clog-tool/clippy
Browse files Browse the repository at this point in the history
v0.11.0
  • Loading branch information
kbknapp authored Jul 8, 2024
2 parents 491a49a + 959b873 commit 0289b1b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
rust:
- stable
- nightly
- 1.58.1 # MSRV
- 1.67.1 # MSRV

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ keywords = ["git", "log", "changelog", "parser", "parse"]
license = "MIT"
name = "clog"
edition = "2021"
version = "0.10.0"
rust-version = "1.58.1" # MSRV
version = "0.11.0"
rust-version = "1.67.1" # MSRV
authors = ["Christoph Burgdorf <christoph.burgdorf@bvsn.org>"]
description = "A conventional changelog for the rest of us"
exclude = ["docs/*"]
Expand Down
7 changes: 2 additions & 5 deletions src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<D>(deserializer: D) -> StdResult<Self, D::Error>
where
Expand Down
7 changes: 2 additions & 5 deletions src/link_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down
11 changes: 4 additions & 7 deletions src/sectionmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 0289b1b

Please sign in to comment.