From 4d0f14d0455fa435df3d8877cb18f5d09820650d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 30 Jan 2024 15:19:00 +0100 Subject: [PATCH] better usage of the lib API --- src/ics.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ics.rs b/src/ics.rs index 2133bbf..2c6fe06 100644 --- a/src/ics.rs +++ b/src/ics.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use chrono::TimeZone; use ics::{ - parameters, + parameters::{Language, TzIDParam}, properties::{ Categories, Class, Comment, Description, DtEnd, DtStart, Location, Summary, Transp, }, @@ -45,12 +45,12 @@ pub fn export(courses: Vec, filename: &mut Str // Start time of the course let mut date_start = DtStart::new(dt_ical(course.dtstart.unwrap())); - date_start.append(parameters!("TZID" => timezone_name)); + date_start.add(TzIDParam::new(timezone_name)); event.push(date_start); // End time of the course let mut date_end = DtEnd::new(dt_ical(course.dtend.unwrap())); - date_end.append(parameters!("TZID" => timezone_name)); + date_end.add(TzIDParam::new(timezone_name)); event.push(date_end); // Room location @@ -65,7 +65,7 @@ pub fn export(courses: Vec, filename: &mut Str // Course's name let mut course_name = Summary::new(format!("{} - {}", categories, course.name)); - course_name.append(parameters!("LANGUAGE" => "fr")); + course_name.add(Language::new("fr")); event.push(course_name); // Course's category