mirror of
https://github.com/lennart-k/rustical.git
synced 2026-01-30 14:08:23 +00:00
update ical-rs
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user