From 6688dcc3833f8edbe69f6d6dbf9ae8407d8d62f8 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sat, 2 Mar 2024 10:08:51 +0100 Subject: WIP CalDAV types --- src/dav/calencoder.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/dav/calencoder.rs') diff --git a/src/dav/calencoder.rs b/src/dav/calencoder.rs index c7708eb..815946e 100644 --- a/src/dav/calencoder.rs +++ b/src/dav/calencoder.rs @@ -50,10 +50,11 @@ impl CalExtension { impl QuickWritable for Violation { async fn write(&self, xml: &mut Writer, ctx: CalExtension) -> Result<(), QError> { match self { - Self::SupportedFilter => { - let start = ctx.create_cal_element("supported-filter"); + Self::ResourceMustBeNull => { + let start = ctx.create_cal_element("resource-must-be-null"); xml.write_event_async(Event::Empty(start)).await?; }, + _ => unimplemented!(), }; Ok(()) } @@ -93,14 +94,14 @@ mod tests { let mut writer = Writer::new_with_indent(&mut tokio_buffer, b' ', 4); let res = Error(vec![ - DavViolation::Extension(Violation::SupportedFilter), + DavViolation::Extension(Violation::ResourceMustBeNull), ]); res.write(&mut writer, CalExtension { root: true }).await.expect("xml serialization"); tokio_buffer.flush().await.expect("tokio buffer flush"); let expected = r#" - + "#; let got = std::str::from_utf8(buffer.as_slice()).unwrap(); -- cgit v1.2.3