Skip to content

Commit 0289b1b

Browse files
authored
Merge pull request #28 from clog-tool/clippy
v0.11.0
2 parents 491a49a + 959b873 commit 0289b1b

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
rust:
1212
- stable
1313
- nightly
14-
- 1.58.1 # MSRV
14+
- 1.67.1 # MSRV
1515

1616
steps:
1717
- uses: actions/checkout@v2

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ keywords = ["git", "log", "changelog", "parser", "parse"]
55
license = "MIT"
66
name = "clog"
77
edition = "2021"
8-
version = "0.10.0"
9-
rust-version = "1.58.1" # MSRV
8+
version = "0.11.0"
9+
rust-version = "1.67.1" # MSRV
1010
authors = ["Christoph Burgdorf <[email protected]>"]
1111
description = "A conventional changelog for the rest of us"
1212
exclude = ["docs/*"]

src/fmt.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ use strum::{Display, EnumString};
88
pub use self::{json_writer::JsonWriter, md_writer::MarkdownWriter};
99
use crate::{clog::Clog, error::Result, sectionmap::SectionMap};
1010

11-
#[derive(Copy, Clone, PartialEq, Eq, Debug, EnumString, Display)]
11+
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, EnumString, Display)]
1212
#[strum(ascii_case_insensitive)]
1313
pub enum ChangelogFormat {
1414
Json,
15+
#[default]
1516
Markdown,
1617
}
1718

18-
impl Default for ChangelogFormat {
19-
fn default() -> Self { ChangelogFormat::Markdown }
20-
}
21-
2219
impl<'de> serde::de::Deserialize<'de> for ChangelogFormat {
2320
fn deserialize<D>(deserializer: D) -> StdResult<Self, D::Error>
2421
where

src/link_style.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@ use strum::{Display, EnumString};
1212
/// let clog = Clog::new().unwrap();
1313
/// clog.link_style(LinkStyle::Stash);
1414
/// ```
15-
#[derive(Debug, Copy, Clone, PartialEq, Eq, Display, EnumString)]
15+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default, Display, EnumString)]
1616
#[strum(ascii_case_insensitive)]
1717
pub enum LinkStyle {
18+
#[default]
1819
Github,
1920
Gitlab,
2021
Stash,
2122
Cgit,
2223
}
2324

24-
impl Default for LinkStyle {
25-
fn default() -> Self { LinkStyle::Github }
26-
}
27-
2825
impl<'de> serde::de::Deserialize<'de> for LinkStyle {
2926
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3027
where

src/sectionmap.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,12 @@ impl SectionMap {
4646
let comp_map = sm
4747
.sections
4848
.entry("Breaking Changes".to_owned())
49-
.or_insert(BTreeMap::new());
50-
let sec_map = comp_map.entry(entry.component.clone()).or_insert(vec![]);
49+
.or_default();
50+
let sec_map = comp_map.entry(entry.component.clone()).or_default();
5151
sec_map.push(entry.clone());
5252
}
53-
let comp_map = sm
54-
.sections
55-
.entry(entry.commit_type.clone())
56-
.or_insert(BTreeMap::new());
57-
let sec_map = comp_map.entry(entry.component.clone()).or_insert(vec![]);
53+
let comp_map = sm.sections.entry(entry.commit_type.clone()).or_default();
54+
let sec_map = comp_map.entry(entry.component.clone()).or_default();
5855
sec_map.push(entry);
5956
}
6057

0 commit comments

Comments
 (0)