From 11462f80c4ae25696c7436ed7aacb92074d7e911 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 8 Mar 2024 09:55:33 +0100 Subject: Re-enable proto --- aero-dav/src/caldecoder.rs | 10 +++++----- aero-dav/src/calencoder.rs | 8 +++----- aero-dav/src/decoder.rs | 15 ++++----------- aero-dav/src/lib.rs | 1 - aero-dav/src/realization.rs | 4 ++-- 5 files changed, 14 insertions(+), 24 deletions(-) (limited to 'aero-dav/src') diff --git a/aero-dav/src/caldecoder.rs b/aero-dav/src/caldecoder.rs index 5f40c4b..fb840d6 100644 --- a/aero-dav/src/caldecoder.rs +++ b/aero-dav/src/caldecoder.rs @@ -1,4 +1,4 @@ -use super::types as dav; +//use super::types as dav; use super::caltypes::*; use super::xml; use super::error; @@ -7,25 +7,25 @@ use super::error; // ---- EXTENSIONS --- impl xml::QRead for Violation { - async fn qread(xml: &mut xml::Reader) -> Result { + async fn qread(_xml: &mut xml::Reader) -> Result { unreachable!(); } } impl xml::QRead for Property { - async fn qread(xml: &mut xml::Reader) -> Result { + async fn qread(_xml: &mut xml::Reader) -> Result { unreachable!(); } } impl xml::QRead for PropertyRequest { - async fn qread(xml: &mut xml::Reader) -> Result { + async fn qread(_xml: &mut xml::Reader) -> Result { unreachable!(); } } impl xml::QRead for ResourceType { - async fn qread(xml: &mut xml::Reader) -> Result { + async fn qread(_xml: &mut xml::Reader) -> Result { unreachable!(); } } diff --git a/aero-dav/src/calencoder.rs b/aero-dav/src/calencoder.rs index ff6eb24..67892ed 100644 --- a/aero-dav/src/calencoder.rs +++ b/aero-dav/src/calencoder.rs @@ -1,7 +1,5 @@ use quick_xml::Error as QError; -use quick_xml::events::{Event, BytesEnd, BytesStart, BytesText}; -use quick_xml::name::PrefixDeclaration; -use tokio::io::AsyncWrite; +use quick_xml::events::{Event, BytesText}; use super::caltypes::*; use super::xml::{Node, QWrite, IWrite, Writer}; @@ -627,7 +625,7 @@ impl QWrite for ParamFilterMatch { impl QWrite for TimeZone { async fn qwrite(&self, xml: &mut Writer) -> Result<(), QError> { - let mut start = xml.create_cal_element("timezone"); + let start = xml.create_cal_element("timezone"); let end = start.to_end(); xml.q.write_event_async(Event::Start(start.clone())).await?; @@ -638,7 +636,7 @@ impl QWrite for TimeZone { impl QWrite for Filter { async fn qwrite(&self, xml: &mut Writer) -> Result<(), QError> { - let mut start = xml.create_cal_element("filter"); + let start = xml.create_cal_element("filter"); let end = start.to_end(); xml.q.write_event_async(Event::Start(start.clone())).await?; diff --git a/aero-dav/src/decoder.rs b/aero-dav/src/decoder.rs index 65cb712..02bc376 100644 --- a/aero-dav/src/decoder.rs +++ b/aero-dav/src/decoder.rs @@ -1,14 +1,9 @@ -use std::future::Future; - use quick_xml::events::Event; -use quick_xml::events::attributes::AttrError; -use quick_xml::name::{Namespace, QName, PrefixDeclaration, ResolveResult, ResolveResult::*}; -use quick_xml::reader::NsReader; -use tokio::io::AsyncBufRead; +use chrono::DateTime; use super::types::*; use super::error::ParsingError; -use super::xml::{Node, QRead, Reader, IRead, DAV_URN, CAL_URN}; +use super::xml::{Node, QRead, Reader, IRead, DAV_URN}; //@TODO (1) Rewrite all objects as Href, // where we return Ok(None) instead of trying to find the object at any cost. @@ -119,7 +114,7 @@ impl QRead for LockInfo { impl QRead> for PropValue { async fn qread(xml: &mut Reader) -> Result { xml.open(DAV_URN, "prop").await?; - let mut acc = xml.collect::>().await?; + let acc = xml.collect::>().await?; xml.close().await?; Ok(PropValue(acc)) } @@ -352,8 +347,6 @@ impl QRead> for PropertyRequest { impl QRead> for Property { async fn qread(xml: &mut Reader) -> Result { - use chrono::{DateTime, FixedOffset, TimeZone}; - // Core WebDAV properties if xml.maybe_open(DAV_URN, "creationdate").await?.is_some() { let datestr = xml.tag_string().await?; @@ -592,7 +585,7 @@ impl QRead for LockType { impl QRead for Href { async fn qread(xml: &mut Reader) -> Result { xml.open(DAV_URN, "href").await?; - let mut url = xml.tag_string().await?; + let url = xml.tag_string().await?; xml.close().await?; Ok(Href(url)) } diff --git a/aero-dav/src/lib.rs b/aero-dav/src/lib.rs index 6bfbf62..0ca8243 100644 --- a/aero-dav/src/lib.rs +++ b/aero-dav/src/lib.rs @@ -1,5 +1,4 @@ #![feature(type_alias_impl_trait)] -#![feature(async_fn_in_trait)] #![feature(async_closure)] #![feature(trait_alias)] diff --git a/aero-dav/src/realization.rs b/aero-dav/src/realization.rs index 33a556e..5781637 100644 --- a/aero-dav/src/realization.rs +++ b/aero-dav/src/realization.rs @@ -6,12 +6,12 @@ use super::error; #[derive(Debug, PartialEq)] pub struct Disabled(()); impl xml::QRead for Disabled { - async fn qread(xml: &mut xml::Reader) -> Result { + async fn qread(_xml: &mut xml::Reader) -> Result { Err(error::ParsingError::Recoverable) } } impl xml::QWrite for Disabled { - async fn qwrite(&self, xml: &mut xml::Writer) -> Result<(), quick_xml::Error> { + async fn qwrite(&self, _xml: &mut xml::Writer) -> Result<(), quick_xml::Error> { unreachable!(); } } -- cgit v1.2.3