Skip to content

Commit

Permalink
fixup! chrono: use timestamp_opt() instead of the deprecated `times…
Browse files Browse the repository at this point in the history
…tamp()` function
  • Loading branch information
OverOrion committed Nov 15, 2022
1 parent d6d6697 commit 89e7ac2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/tls-websocket-server/src/certificate_generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn ed25519_self_signed_certificate(
) -> WebSocketResult<Certificate> {
let mut params = CertificateParams::new(vec![common_name.to_string()]);
let now = SystemTime::now().duration_since(UNIX_EPOCH).expect("Error: UNIX_EPOCH");
let issue_ts = TzUtc.timestamp_opt(now.as_secs() as i64, 0).unwrap();
let issue_ts = TzUtc.timestamp_opt(now.as_secs() as i64, 0).expect("Error: this should not fail as long as secs fit into i64");
let year = issue_ts.year();
let month = issue_ts.month();
let day = issue_ts.day();
Expand Down

0 comments on commit 89e7ac2

Please sign in to comment.