mirror of
https://git.deuxfleurs.fr/Deuxfleurs/garage.git
synced 2024-11-25 09:31:00 +00:00
util/time.rs: Updated deprecated associated function to timestamp_opt().
This commit is contained in:
parent
bcac889f9a
commit
b4a1a6a32f
1 changed files with 1 additions and 1 deletions
|
@ -25,6 +25,6 @@ pub fn increment_logical_clock_2(prev: u64, prev2: u64) -> u64 {
|
||||||
pub fn msec_to_rfc3339(msecs: u64) -> String {
|
pub fn msec_to_rfc3339(msecs: u64) -> String {
|
||||||
let secs = msecs as i64 / 1000;
|
let secs = msecs as i64 / 1000;
|
||||||
let nanos = (msecs as i64 % 1000) as u32 * 1_000_000;
|
let nanos = (msecs as i64 % 1000) as u32 * 1_000_000;
|
||||||
let timestamp = Utc.timestamp(secs, nanos);
|
let timestamp = Utc.timestamp_opt(secs, nanos).unwrap();
|
||||||
timestamp.to_rfc3339_opts(SecondsFormat::Millis, true)
|
timestamp.to_rfc3339_opts(SecondsFormat::Millis, true)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue