Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.11.0 #28

Merged
merged 4 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>"]
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
Loading