From cb26d106e69f654dbab731bf1105bddc14ec6ae3 Mon Sep 17 00:00:00 2001 From: David Quintanel Date: Wed, 6 Sep 2023 10:16:56 +0200 Subject: [PATCH] [fix] clippy warnings --- src/netex_france/calendars.rs | 3 ++- src/netex_france/exporter.rs | 7 +++++-- src/ntfs/read.rs | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/netex_france/calendars.rs b/src/netex_france/calendars.rs index bbaa07fcf..3a0f0d00c 100644 --- a/src/netex_france/calendars.rs +++ b/src/netex_france/calendars.rs @@ -106,7 +106,8 @@ impl<'a> CalendarExporter<'a> { fn generate_from_date(date: Date) -> Element { let date_string = - DateTime::::from_utc(date.and_hms_opt(0, 0, 0).unwrap(), Utc).to_rfc3339(); + DateTime::::from_naive_utc_and_offset(date.and_hms_opt(0, 0, 0).unwrap(), Utc) + .to_rfc3339(); Element::builder("FromDate") .append(Node::Text(date_string)) .build() diff --git a/src/netex_france/exporter.rs b/src/netex_france/exporter.rs index 58e3c5965..8bb70fbea 100644 --- a/src/netex_france/exporter.rs +++ b/src/netex_france/exporter.rs @@ -374,8 +374,11 @@ impl Exporter<'_> { fn create_valid_between(&self) -> Result { let format_date = |date: Date, hour, minute, second| -> String { - DateTime::::from_utc(date.and_hms_opt(hour, minute, second).unwrap(), Utc) - .to_rfc3339() + DateTime::::from_naive_utc_and_offset( + date.and_hms_opt(hour, minute, second).unwrap(), + Utc, + ) + .to_rfc3339() }; let (start_date, end_date) = self.model.calculate_validity_period()?; let from_date = Element::builder("FromDate") diff --git a/src/ntfs/read.rs b/src/ntfs/read.rs index e78741906..fbcadb711 100644 --- a/src/ntfs/read.rs +++ b/src/ntfs/read.rs @@ -438,7 +438,6 @@ where "comment.txt: comment_id={} not found", comment_link.comment_id ); - } else { } collection .index_mut(idx)