Skip to content

Commit

Permalink
fix: convert error
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyc committed Oct 24, 2024
1 parent 7dc4776 commit 4a580b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pisugar-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ impl PiSugarCore {
/// Get ntp datetime.
pub async fn get_ntp_datetime() -> Result<DateTime<Utc>> {
let sntp_client = AsyncSntpClient::new();
let result = sntp_client.synchronize(NTP_ADDR).await?;
let result = sntp_client.synchronize(NTP_ADDR).await.map_err(|e| Error::Other(format!("{}", e)))?;
Ok(result.datetime().into_chrono_datetime().map_err(|e| Error::Other(format!("{}", e)))?)
}

Expand Down

0 comments on commit 4a580b8

Please sign in to comment.