Skip to content

Commit 3d24d26

Browse files
gordonwang0onalante-msft
authored andcommitted
clippy fix
1 parent 13e7e90 commit 3d24d26

File tree

1 file changed

+5
-3
lines changed
  • identity/aziot-identityd/src

1 file changed

+5
-3
lines changed

identity/aziot-identityd/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -907,9 +907,11 @@ fn get_cert_expiration(cert: &str) -> Result<String, Error> {
907907
.diff(cert.not_after())
908908
.map_err(|err| Error::Internal(InternalError::CreateCertificate(Box::new(err))))?;
909909
let diff = i64::from(diff.secs) + i64::from(diff.days) * 86400;
910-
let expiration = chrono::NaiveDateTime::from_timestamp_opt(diff, 0).ok_or(Error::Internal(
911-
InternalError::CreateCertificate("failed to convert timestamp".into()),
912-
))?;
910+
let expiration = chrono::NaiveDateTime::from_timestamp_opt(diff, 0).ok_or_else(|| {
911+
Error::Internal(InternalError::CreateCertificate(
912+
"failed to convert timestamp".into(),
913+
))
914+
})?;
913915
let expiration =
914916
chrono::DateTime::<chrono::Utc>::from_utc(expiration, chrono::Utc).to_rfc3339();
915917

0 commit comments

Comments
 (0)