From 41eed732eb140f356c115a4dc3b60aa7f342c479 Mon Sep 17 00:00:00 2001 From: Lennart K <18233294+lennart-k@users.noreply.github.com> Date: Sat, 31 Jan 2026 14:17:10 +0100 Subject: [PATCH] Update caldata-rs --- Cargo.lock | 21 +++---------------- Cargo.toml | 3 +-- crates/caldav/src/calendar/methods/get.rs | 8 +++---- crates/caldav/src/calendar/methods/import.rs | 8 +++---- .../carddav/src/addressbook/methods/import.rs | 2 +- crates/dav/src/xml/text_match.rs | 3 +-- crates/ical/Cargo.toml | 1 - crates/ical/src/address_object.rs | 14 ++++++------- crates/store/Cargo.toml | 1 - 9 files changed, 21 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b452362..2c39406 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -567,18 +567,18 @@ checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "caldata" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36de4a8034d98c95e7fe874b828272d823cfbd68e9571fe7bf6c419e852cbe2" +checksum = "e18d0b0cbc271e44b6f0dc262c9469f10f10f8af3fa00c3ebcc10e49ac91d478" dependencies = [ "chrono", "chrono-tz", "derive_more", "itertools 0.14.0", "lazy_static", + "log", "phf 0.13.1", "regex", - "rrule", "thiserror 2.0.18", "vtimezones-rs", ] @@ -3169,19 +3169,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "rrule" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720acfb4980b9d8a6a430f6d7a11933e701ebbeba5eee39cc9d8c5f932aaff74" -dependencies = [ - "chrono", - "chrono-tz", - "log", - "regex", - "thiserror 2.0.18", -] - [[package]] name = "rsa" version = "0.9.10" @@ -3530,7 +3517,6 @@ dependencies = [ "chrono-tz", "derive_more", "regex", - "rrule", "rstest", "rustical_xml", "serde", @@ -3571,7 +3557,6 @@ dependencies = [ "headers", "http", "regex", - "rrule", "rstest", "rstest_reuse", "rustical_dav", diff --git a/Cargo.toml b/Cargo.toml index 5c296f9..9861258 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -111,7 +111,7 @@ strum = "0.27" strum_macros = "0.27" serde_json = { version = "1.0", features = ["raw_value"] } sqlx-sqlite = { version = "0.8", features = ["bundled"] } -caldata = { version = "0.14.0", features = ["chrono-tz", "vtimezones-rs"] } +caldata = { version = "0.15.0", features = ["chrono-tz", "vtimezones-rs"] } toml = "0.9" tower = "0.5" tower-http = { version = "0.6", features = [ @@ -124,7 +124,6 @@ chrono-tz = "0.10" chrono-humanize = "0.2" rand = "0.9" axum-extra = { version = "0.12", features = ["typed-header"] } -rrule = "0.14" argon2 = "0.5" rpassword = "7.4" password-hash = { version = "0.5" } diff --git a/crates/caldav/src/calendar/methods/get.rs b/crates/caldav/src/calendar/methods/get.rs index f33433f..90655b0 100644 --- a/crates/caldav/src/calendar/methods/get.rs +++ b/crates/caldav/src/calendar/methods/get.rs @@ -43,28 +43,28 @@ pub async fn route_get( if let Some(displayname) = calendar.meta.displayname { props.push(ContentLine { name: "X-WR-CALNAME".to_owned(), - value: Some(displayname), + value: displayname, params: vec![].into(), }); } if let Some(description) = calendar.meta.description { props.push(ContentLine { name: "X-WR-CALDESC".to_owned(), - value: Some(description), + value: description, params: vec![].into(), }); } if let Some(color) = calendar.meta.color { props.push(ContentLine { name: "X-WR-CALCOLOR".to_owned(), - value: Some(color), + value: color, params: vec![].into(), }); } if let Some(timezone_id) = calendar.timezone_id { props.push(ContentLine { name: "X-WR-TIMEZONE".to_owned(), - value: Some(timezone_id), + value: timezone_id, params: vec![].into(), }); } diff --git a/crates/caldav/src/calendar/methods/import.rs b/crates/caldav/src/calendar/methods/import.rs index 33ffd63..be9a7ad 100644 --- a/crates/caldav/src/calendar/methods/import.rs +++ b/crates/caldav/src/calendar/methods/import.rs @@ -35,16 +35,16 @@ pub async fn route_import( // Extract calendar metadata let displayname = cal .get_property("X-WR-CALNAME") - .and_then(|prop| prop.value.clone()); + .map(|prop| prop.value.clone()); let description = cal .get_property("X-WR-CALDESC") - .and_then(|prop| prop.value.clone()); + .map(|prop| prop.value.clone()); let color = cal .get_property("X-WR-CALCOLOR") - .and_then(|prop| prop.value.clone()); + .map(|prop| prop.value.clone()); let timezone_id = cal .get_property("X-WR-TIMEZONE") - .and_then(|prop| prop.value.clone()); + .map(|prop| prop.value.clone()); // These properties should not appear in the expanded calendar objects cal.remove_property("X-WR-CALNAME"); cal.remove_property("X-WR-CALDESC"); diff --git a/crates/carddav/src/addressbook/methods/import.rs b/crates/carddav/src/addressbook/methods/import.rs index 4b7eb76..5f86e80 100644 --- a/crates/carddav/src/addressbook/methods/import.rs +++ b/crates/carddav/src/addressbook/methods/import.rs @@ -34,7 +34,7 @@ pub async fn route_import( let mut card_mut = card.mutable(); card_mut.add_content_line(ContentLine { name: "UID".to_owned(), - value: Some(uuid::Uuid::new_v4().to_string()), + value: uuid::Uuid::new_v4().to_string(), params: vec![].into(), }); card = card_mut.build(&ParserOptions::default(), None).unwrap(); diff --git a/crates/dav/src/xml/text_match.rs b/crates/dav/src/xml/text_match.rs index 77a617a..bad335a 100644 --- a/crates/dav/src/xml/text_match.rs +++ b/crates/dav/src/xml/text_match.rs @@ -129,8 +129,7 @@ impl TextMatchElement { } #[must_use] pub fn match_property(&self, property: &ContentLine) -> bool { - let text = property.value.as_deref().unwrap_or(""); - self.match_text(text) + self.match_text(&property.value) } } diff --git a/crates/ical/Cargo.toml b/crates/ical/Cargo.toml index 16c44d9..5f8881c 100644 --- a/crates/ical/Cargo.toml +++ b/crates/ical/Cargo.toml @@ -17,7 +17,6 @@ derive_more.workspace = true rustical_xml.workspace = true caldata.workspace = true regex.workspace = true -rrule.workspace = true serde.workspace = true sha2.workspace = true axum.workspace = true diff --git a/crates/ical/src/address_object.rs b/crates/ical/src/address_object.rs index 2ee571b..70d2267 100644 --- a/crates/ical/src/address_object.rs +++ b/crates/ical/src/address_object.rs @@ -13,7 +13,7 @@ use caldata::{ IcalUIDProperty, IcalVERSIONProperty, IcalVersion, VcardANNIVERSARYProperty, VcardBDAYProperty, VcardFNProperty, }, - types::{CalDate, PartialDate, Timezone}, + types::{CalDate, PartialDate, Tz}, }; use chrono::{NaiveDate, Utc}; use sha2::{Digest, Sha256}; @@ -73,7 +73,7 @@ impl AddressObject { let Some(dtstart) = NaiveDate::from_ymd_opt(year.unwrap_or(1900), month, day) else { return Ok(None); }; - let start_date = CalDate(dtstart, Timezone::Local); + let start_date = CalDate(dtstart, Tz::Local); let Some(end_date) = start_date.succ_opt() else { // start_date is MAX_DATE, this should never happen but FAPP also not raise an error return Ok(None); @@ -90,14 +90,14 @@ impl AddressObject { IcalDTENDProperty(end_date.into(), vec![].into()).into(), IcalUIDProperty(uid, vec![].into()).into(), IcalRRULEProperty( - rrule::RRule::from_str("FREQ=YEARLY").unwrap(), + caldata::rrule::RRule::from_str("FREQ=YEARLY").unwrap(), vec![].into(), ) .into(), IcalSUMMARYProperty(summary.clone(), vec![].into()).into(), ContentLine { name: "TRANSP".to_owned(), - value: Some("TRANSPARENT".to_owned()), + value: "TRANSPARENT".to_owned(), ..Default::default() }, ], @@ -105,17 +105,17 @@ impl AddressObject { properties: vec![ ContentLine { name: "TRIGGER".to_owned(), - value: Some("-PT0M".to_owned()), + value: "-PT0M".to_owned(), params: vec![("VALUE".to_owned(), vec!["DURATION".to_owned()])].into(), }, ContentLine { name: "ACTION".to_owned(), - value: Some("DISPLAY".to_owned()), + value: "DISPLAY".to_owned(), ..Default::default() }, ContentLine { name: "DESCRIPTION".to_owned(), - value: Some(summary), + value: summary, ..Default::default() }, ], diff --git a/crates/store/Cargo.toml b/crates/store/Cargo.toml index ca722b6..0d47923 100644 --- a/crates/store/Cargo.toml +++ b/crates/store/Cargo.toml @@ -27,7 +27,6 @@ rustical_dav.workspace = true rustical_ical.workspace = true axum.workspace = true http.workspace = true -rrule.workspace = true headers.workspace = true tower.workspace = true futures-core.workspace = true