From 48eac07947a46f9648f357080f73d9427a445d39 Mon Sep 17 00:00:00 2001 From: SequeI Date: Tue, 12 Nov 2024 00:33:46 +0000 Subject: [PATCH 1/2] fixing datetime tuf specification --- tuftool/src/datetime.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tuftool/src/datetime.rs b/tuftool/src/datetime.rs index ae60e721..bf32ad8a 100644 --- a/tuftool/src/datetime.rs +++ b/tuftool/src/datetime.rs @@ -3,7 +3,7 @@ use crate::error::{self, Result}; -use chrono::{DateTime, FixedOffset, TimeDelta, Utc}; +use chrono::{DateTime, FixedOffset, TimeDelta,Timelike, Utc}; use snafu::{ensure, OptionExt, ResultExt}; /// Parses a user-specified datetime, either in full RFC 3339 format, or a shorthand like "in 7 @@ -71,6 +71,6 @@ pub(crate) fn parse_datetime(input: &str) -> Result> { }; let now = Utc::now(); - let then = now + duration; + let then = (now + duration).with_nanosecond(0).unwrap(); Ok(then) } From d451286fa9b87168a1907468ee97ebb47fc3f686 Mon Sep 17 00:00:00 2001 From: SequeI Date: Mon, 18 Nov 2024 02:10:31 +0000 Subject: [PATCH 2/2] lint --- tuftool/src/datetime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuftool/src/datetime.rs b/tuftool/src/datetime.rs index bf32ad8a..23094467 100644 --- a/tuftool/src/datetime.rs +++ b/tuftool/src/datetime.rs @@ -3,7 +3,7 @@ use crate::error::{self, Result}; -use chrono::{DateTime, FixedOffset, TimeDelta,Timelike, Utc}; +use chrono::{DateTime, FixedOffset, TimeDelta, Timelike, Utc}; use snafu::{ensure, OptionExt, ResultExt}; /// Parses a user-specified datetime, either in full RFC 3339 format, or a shorthand like "in 7