Skip to content

Commit 3b5bfe8

Browse files
committed
Appease Clippy
1 parent e0588e8 commit 3b5bfe8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

p2pd-oracle-client/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern crate reqwest;
1818
extern crate secp256k1_zkp;
1919
extern crate serde;
2020

21-
use chrono::{DateTime, NaiveDateTime, SecondsFormat, Utc};
21+
use chrono::{DateTime, SecondsFormat, Utc};
2222
use dlc_manager::error::Error as DlcManagerError;
2323
use dlc_manager::Oracle;
2424
use dlc_messages::oracle_msgs::{OracleAnnouncement, OracleAttestation};
@@ -132,10 +132,9 @@ fn parse_event_id(event_id: &str) -> Result<(String, DateTime<Utc>), DlcManagerE
132132
let timestamp: i64 = timestamp_str
133133
.parse()
134134
.map_err(|_| DlcManagerError::OracleError("Invalid timestamp format".to_string()))?;
135-
let naive_date_time = NaiveDateTime::from_timestamp_opt(timestamp, 0).ok_or_else(|| {
135+
let date_time = DateTime::<Utc>::from_timestamp(timestamp, 0).ok_or_else(|| {
136136
DlcManagerError::InvalidParameters(format!("Invalid timestamp {} in event id", timestamp))
137137
})?;
138-
let date_time = DateTime::from_naive_utc_and_offset(naive_date_time, Utc);
139138
Ok((asset_id.to_string(), date_time))
140139
}
141140

0 commit comments

Comments
 (0)