aboutsummaryrefslogtreecommitdiff
path: root/aero-dav/src
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-03-08 09:55:33 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-03-08 09:55:33 +0100
commit11462f80c4ae25696c7436ed7aacb92074d7e911 (patch)
tree333677df5ea981b0e1468b43fc00df9d242ad4fa /aero-dav/src
parent1edf0b15ecaa73d55bb72c6f3c6e25d4f231f322 (diff)
downloadaerogramme-11462f80c4ae25696c7436ed7aacb92074d7e911.tar.gz
aerogramme-11462f80c4ae25696c7436ed7aacb92074d7e911.zip
Re-enable proto
Diffstat (limited to 'aero-dav/src')
-rw-r--r--aero-dav/src/caldecoder.rs10
-rw-r--r--aero-dav/src/calencoder.rs8
-rw-r--r--aero-dav/src/decoder.rs15
-rw-r--r--aero-dav/src/lib.rs1
-rw-r--r--aero-dav/src/realization.rs4
5 files changed, 14 insertions, 24 deletions
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<Violation> for Violation {
- async fn qread(xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
+ async fn qread(_xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
unreachable!();
}
}
impl xml::QRead<Property> for Property {
- async fn qread(xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
+ async fn qread(_xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
unreachable!();
}
}
impl xml::QRead<PropertyRequest> for PropertyRequest {
- async fn qread(xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
+ async fn qread(_xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
unreachable!();
}
}
impl xml::QRead<ResourceType> for ResourceType {
- async fn qread(xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
+ async fn qread(_xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
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<impl IWrite>) -> 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<impl IWrite>) -> 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<LockInfo> for LockInfo {
impl<E: Extension> QRead<PropValue<E>> for PropValue<E> {
async fn qread(xml: &mut Reader<impl IRead>) -> Result<Self, ParsingError> {
xml.open(DAV_URN, "prop").await?;
- let mut acc = xml.collect::<Property<E>>().await?;
+ let acc = xml.collect::<Property<E>>().await?;
xml.close().await?;
Ok(PropValue(acc))
}
@@ -352,8 +347,6 @@ impl<E: Extension> QRead<PropertyRequest<E>> for PropertyRequest<E> {
impl<E: Extension> QRead<Property<E>> for Property<E> {
async fn qread(xml: &mut Reader<impl IRead>) -> Result<Self, ParsingError> {
- 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<LockType> for LockType {
impl QRead<Href> for Href {
async fn qread(xml: &mut Reader<impl IRead>) -> Result<Self, ParsingError> {
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<Disabled> for Disabled {
- async fn qread(xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
+ async fn qread(_xml: &mut xml::Reader<impl xml::IRead>) -> Result<Self, error::ParsingError> {
Err(error::ParsingError::Recoverable)
}
}
impl xml::QWrite for Disabled {
- async fn qwrite(&self, xml: &mut xml::Writer<impl xml::IWrite>) -> Result<(), quick_xml::Error> {
+ async fn qwrite(&self, _xml: &mut xml::Writer<impl xml::IWrite>) -> Result<(), quick_xml::Error> {
unreachable!();
}
}