From f167e8b591ede98ea334a4f708aa33fb1bd4a9d4 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 26 Jul 2019 01:54:26 +0200 Subject: [PATCH] date: Follow clippy and remove a harmful reference. --- src/date.rs | 4 ++-- src/time.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/date.rs b/src/date.rs index 73dd3bd..e5fd67e 100644 --- a/src/date.rs +++ b/src/date.rs @@ -22,8 +22,8 @@ impl DateTime { } /// Returns a new `DateTime` with a different timezone. - pub fn with_timezone(&self, tz: &FixedOffset) -> DateTime { - DateTime(self.0.with_timezone(tz)) + pub fn with_timezone(&self, tz: FixedOffset) -> DateTime { + DateTime(self.0.with_timezone(&tz)) } /// Formats this `DateTime` with the specified format string. diff --git a/src/time.rs b/src/time.rs index 9186666..cbedb98 100644 --- a/src/time.rs +++ b/src/time.rs @@ -67,7 +67,7 @@ impl TryFrom for TimeResult { let tzo = tzo.ok_or(Error::ParseError("Missing tzo child in time element."))?; let utc = utc.ok_or(Error::ParseError("Missing utc child in time element."))?; - let date = utc.with_timezone(&tzo); + let date = utc.with_timezone(tzo); Ok(TimeResult(date)) } @@ -81,7 +81,7 @@ impl From for Element { .append(format!("{}", time.0.timezone())) .build()) .append(Element::builder("utc") - .append(time.0.with_timezone(&FixedOffset::east(0)).format("%FT%TZ")) + .append(time.0.with_timezone(FixedOffset::east(0)).format("%FT%TZ")) .build()) .build() }