Skip to content

Commit 1fd6c21

Browse files
committed
chore: Update for chrono deprecations
The non-deprecated east_opt() and timestamp_opt() interfaces return Option/Result, but these changes stick with the expect/unwrap approach to those outcomes. I.e. this change maintains StGit's status quo which is to panic if a timestamp found in the git repo has an out-of-bounds timezone or unix timestamp.
1 parent 8df9216 commit 1fd6c21

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/signature.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ pub(crate) trait TimeExtended {
187187

188188
impl TimeExtended for git2::Time {
189189
fn datetime(&self) -> DateTime<FixedOffset> {
190-
FixedOffset::east(self.offset_minutes() * 60).timestamp(self.seconds(), 0)
190+
FixedOffset::east_opt(self.offset_minutes() * 60)
191+
.expect("tz offset minues is in bounds")
192+
.timestamp_opt(self.seconds(), 0)
193+
.unwrap()
191194
}
192195

193196
fn epoch_time_string(&self) -> String {

0 commit comments

Comments
 (0)