use std::fmt::Display;
#[derive(Clone, Debug, PartialEq, Hash, Eq)]
pub struct ConventionalCommit {
pub message: String,
}
impl ConventionalCommit {
pub fn from_git2_commit(commit: git2::Commit) -> Self {
Self {
message: commit.message().unwrap().to_string(),
}
}
pub fn message(&self) -> &str {
&self.message
}
}
impl Display for ConventionalCommit {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.message)
}
}