Skip to content

Commit

Permalink
revert: remove commit sort struct
Browse files Browse the repository at this point in the history
  • Loading branch information
oknozor committed Sep 12, 2020
1 parent dad15d1 commit 329587f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
13 changes: 0 additions & 13 deletions src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,6 @@ pub struct CommitConfig {
pub help_message: String,
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum SortCommit {
ByType,
ByScope,
}

impl Default for SortCommit {
fn default() -> Self {
SortCommit::ByType
}
}

impl CommitConfig {
pub(crate) fn new(changelog_title: &str, help_message: &str) -> Self {
CommitConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl CocoGitto {
);
Ok(())
}
Err(err) => Err(err)
Err(err) => Err(err),
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ impl Repository {
}

pub(crate) fn get_author(&self) -> Result<String> {
self.0.signature()?.name()
self.0
.signature()?
.name()
.map(|name| name.to_string())
.ok_or_else(|| anyhow!("Cannot get committer name"))
}
Expand Down
4 changes: 1 addition & 3 deletions src/settings.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::commit::{CommitConfig, CommitType, SortCommit};
use crate::commit::{CommitConfig, CommitType};
use crate::repository::Repository;
use crate::CommitsMetadata;
use anyhow::Result;
Expand All @@ -17,8 +17,6 @@ pub(crate) struct Settings {
pub changelog_path: Option<PathBuf>,
pub changelog_header: Option<String>,
pub changelog_footer: Option<String>,
#[serde(default)]
pub sort_commit: SortCommit,
}

impl Settings {
Expand Down

0 comments on commit 329587f

Please sign in to comment.