git-next/crates/git/src/commit.rs
Paul Campbell eb7d14bc33
All checks were successful
/ test (push) Successful in 2s
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
refactor(git): more derive_more replacing boilerplate
2024-05-15 20:40:25 +01:00

20 lines
547 B
Rust

#[derive(Clone, Debug, PartialEq, Eq, derive_more::Constructor, derive_more::Display)]
#[display("{}", sha)]
pub struct Commit {
sha: Sha,
message: Message,
}
impl Commit {
pub const fn sha(&self) -> &Sha {
&self.sha
}
pub const fn message(&self) -> &Message {
&self.message
}
}
#[derive(Clone, Debug, PartialEq, Eq, derive_more::Constructor, derive_more::Display)]
pub struct Sha(String);
#[derive(Clone, Debug, PartialEq, Eq, derive_more::Constructor, derive_more::Display)]
pub struct Message(String);