update ical-rs

This commit is contained in:
Lennart K
2026-01-12 14:04:11 +01:00
parent 5f68a5ae5c
commit c165e761be
9 changed files with 39 additions and 43 deletions

View File

@@ -1,5 +1,3 @@
use std::{collections::HashMap, io::BufReader};
use crate::Error;
use crate::addressbook::AddressbookResourceService;
use axum::{
@@ -12,6 +10,7 @@ use ical::{
property::ContentLine,
};
use rustical_store::{Addressbook, AddressbookStore, SubscriptionStore, auth::Principal};
use std::io::BufReader;
use tracing::instrument;
#[instrument(skip(resource_service))]
@@ -38,7 +37,7 @@ pub async fn route_import<AS: AddressbookStore, S: SubscriptionStore>(
value: Some(uuid::Uuid::new_v4().to_string()),
params: vec![].into(),
});
card = card_mut.build(&HashMap::new()).unwrap();
card = card_mut.build(None).unwrap();
}
// TODO: Make nicer
let uid = card.get_uid().unwrap();

View File

@@ -56,22 +56,22 @@ impl PropFilterElement {
}
pub fn match_component(&self, comp: &impl PropFilterable) -> bool {
let properties = comp.get_named_properties(&self.name);
let mut properties = comp.get_named_properties(&self.name);
if self.is_not_defined.is_some() {
return properties.is_empty();
return properties.next().is_none();
}
// The filter matches when one property instance matches
properties.iter().any(|prop| self.match_property(prop))
properties.any(|prop| self.match_property(prop))
}
}
pub trait PropFilterable {
fn get_named_properties(&self, name: &str) -> Vec<&ContentLine>;
fn get_named_properties<'a>(&'a self, name: &'a str) -> impl Iterator<Item = &'a ContentLine>;
}
impl PropFilterable for AddressObject {
fn get_named_properties(&self, name: &str) -> Vec<&ContentLine> {
fn get_named_properties<'a>(&'a self, name: &'a str) -> impl Iterator<Item = &'a ContentLine> {
self.get_vcard().get_named_properties(name)
}
}