Skip to content

Commit

Permalink
clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwang0 authored and onalante-msft committed Jan 19, 2023
1 parent 13e7e90 commit 3d24d26
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions identity/aziot-identityd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,11 @@ fn get_cert_expiration(cert: &str) -> Result<String, Error> {
.diff(cert.not_after())
.map_err(|err| Error::Internal(InternalError::CreateCertificate(Box::new(err))))?;
let diff = i64::from(diff.secs) + i64::from(diff.days) * 86400;
let expiration = chrono::NaiveDateTime::from_timestamp_opt(diff, 0).ok_or(Error::Internal(
InternalError::CreateCertificate("failed to convert timestamp".into()),
))?;
let expiration = chrono::NaiveDateTime::from_timestamp_opt(diff, 0).ok_or_else(|| {
Error::Internal(InternalError::CreateCertificate(
"failed to convert timestamp".into(),
))
})?;
let expiration =
chrono::DateTime::<chrono::Utc>::from_utc(expiration, chrono::Utc).to_rfc3339();

Expand Down

0 comments on commit 3d24d26

Please sign in to comment.