diff --git a/src/components.rs b/src/components.rs index 7167804..7f867a5 100644 --- a/src/components.rs +++ b/src/components.rs @@ -164,7 +164,7 @@ pub trait Component { /// /// This must be a UTC date-time value. fn timestamp(&mut self, dt: DateTime) -> &mut Self { - self.add_property("DTSTAMP", &format_utc_date_time(dt)) + self.add_property("DTSTAMP", format_utc_date_time(dt)) } /// Gets the [`DTSTAMP`](https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.7.2) property. @@ -187,7 +187,7 @@ pub trait Component { /// Ranges from 0 to 10, larger values will be truncated fn priority(&mut self, priority: u32) -> &mut Self { let priority = std::cmp::min(priority, 10); - self.add_property("PRIORITY", &priority.to_string()) + self.add_property("PRIORITY", priority.to_string()) } // /// Add the [`ATTACH`](https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.1) property diff --git a/src/components/date_time.rs b/src/components/date_time.rs index 3d3e88b..0ecb569 100644 --- a/src/components/date_time.rs +++ b/src/components/date_time.rs @@ -28,7 +28,7 @@ pub(crate) fn parse_duration(s: &str) -> Option { } pub(crate) fn naive_date_to_property(date: NaiveDate, key: &str) -> Property { - Property::new(key, &date.format(NAIVE_DATE_FORMAT).to_string()) + Property::new(key, date.format(NAIVE_DATE_FORMAT).to_string()) .append_parameter(ValueType::Date) .done() } @@ -97,11 +97,11 @@ impl CalendarDateTime { pub(crate) fn to_property(&self, key: &str) -> Property { match self { CalendarDateTime::Floating(naive_dt) => { - Property::new(key, &naive_dt.format(NAIVE_DATE_TIME_FORMAT).to_string()) + Property::new(key, naive_dt.format(NAIVE_DATE_TIME_FORMAT).to_string()) } - CalendarDateTime::Utc(utc_dt) => Property::new(key, &format_utc_date_time(*utc_dt)), + CalendarDateTime::Utc(utc_dt) => Property::new(key, format_utc_date_time(*utc_dt)), CalendarDateTime::WithTimezone { date_time, tzid } => { - Property::new(key, &date_time.format(NAIVE_DATE_TIME_FORMAT).to_string()) + Property::new(key, date_time.format(NAIVE_DATE_TIME_FORMAT).to_string()) .add_parameter("TZID", tzid) .done() } diff --git a/src/components/todo.rs b/src/components/todo.rs index dfdb6c4..aa4a214 100644 --- a/src/components/todo.rs +++ b/src/components/todo.rs @@ -26,7 +26,7 @@ impl Todo { /// /// Ranges between 0 - 100 pub fn percent_complete(&mut self, percent: u8) -> &mut Self { - self.add_property("PERCENT-COMPLETE", &percent.to_string()) + self.add_property("PERCENT-COMPLETE", percent.to_string()) } /// Gets the [`PERCENT-COMPLETE`](https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.8) property. @@ -54,7 +54,7 @@ impl Todo { /// Per [RFC 5545, Section 3.8.2.1](https://tools.ietf.org/html/rfc5545#section-3.8.2.1), this /// must be a date-time in UTC format. pub fn completed(&mut self, dt: DateTime) -> &mut Self { - self.add_property("COMPLETED", &format_utc_date_time(dt)) + self.add_property("COMPLETED", format_utc_date_time(dt)) } /// Gets the [`COMPLETED`](https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.2.1) property