From e1d7cf88afd9baab67d53823e95cb1b7f240802f Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 24 Apr 2024 17:35:00 +0200 Subject: Working ICS GET/PUT/DELETE --- aero-collections/src/calendar/mod.rs | 2 +- aero-collections/src/davdag.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'aero-collections/src') diff --git a/aero-collections/src/calendar/mod.rs b/aero-collections/src/calendar/mod.rs index feae73e..028cf87 100644 --- a/aero-collections/src/calendar/mod.rs +++ b/aero-collections/src/calendar/mod.rs @@ -155,7 +155,7 @@ impl CalendarInternal { async fn delete(&mut self, blob_id: BlobId) -> Result { let davstate = self.davdag.state(); - if davstate.table.contains_key(&blob_id) { + if !davstate.table.contains_key(&blob_id) { bail!("Cannot delete event that doesn't exist"); } diff --git a/aero-collections/src/davdag.rs b/aero-collections/src/davdag.rs index 3aaebb8..7335bdc 100644 --- a/aero-collections/src/davdag.rs +++ b/aero-collections/src/davdag.rs @@ -202,6 +202,16 @@ impl DavDag { } } +impl std::fmt::Debug for DavDag { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("DavDag\n")?; + for elem in self.table.iter() { + f.write_fmt(format_args!("\t{:?} => {:?}", elem.0, elem.1))?; + } + Ok(()) + } +} + impl BayouState for DavDag { type Op = DavDagOp; -- cgit v1.2.3