File tree 1 file changed +5
-3
lines changed
identity/aziot-identityd/src
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -907,9 +907,11 @@ fn get_cert_expiration(cert: &str) -> Result<String, Error> {
907
907
. diff ( cert. not_after ( ) )
908
908
. map_err ( |err| Error :: Internal ( InternalError :: CreateCertificate ( Box :: new ( err) ) ) ) ?;
909
909
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
+ } ) ?;
913
915
let expiration =
914
916
chrono:: DateTime :: < chrono:: Utc > :: from_utc ( expiration, chrono:: Utc ) . to_rfc3339 ( ) ;
915
917
You can’t perform that action at this time.
0 commit comments