Skip to content

Commit

Permalink
fix: use from_timestamp_opt for the deprecation warning of chrono
Browse files Browse the repository at this point in the history
  • Loading branch information
zitsen committed Nov 29, 2022
1 parent e5ae526 commit 711e0f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion taos-query/src/common/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ impl Timestamp {
Timestamp::Microseconds(raw) => chrono::Duration::microseconds(*raw),
Timestamp::Nanoseconds(raw) => chrono::Duration::nanoseconds(*raw),
};
chrono::NaiveDateTime::from_timestamp(0, 0)
chrono::NaiveDateTime::from_timestamp_opt(0, 0)
.expect("timestamp value could always be mapped to a chrono::NaiveDateTime")
.checked_add_signed(duration)
.unwrap()
}
Expand Down

0 comments on commit 711e0f8

Please sign in to comment.