Merge remote-tracking branch 'origin/commit/time-accessors'

* origin/commit/time-accessors:
  git-commit: add Time accessors

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
This commit is contained in:
Fintan Halpenny
2022-12-22 10:50:18 +00:00
+10
View File
@@ -33,6 +33,16 @@ impl Time {
pub fn new(seconds: i64, offset: i32) -> Self {
Self { seconds, offset }
}
/// Return the time, in seconds, since the epoch.
pub fn seconds(&self) -> i64 {
self.seconds
}
/// Return the timezone offset, in minutes.
pub fn offset(&self) -> i32 {
self.offset
}
}
impl From<Time> for git2::Time {