mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 01:12:24 +00:00
Lots of clippy appeasement
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::{ContentUpdate, PropertyUpdate, SupportedTriggers, Transports, Trigge
|
||||
use rustical_dav::header::Depth;
|
||||
use rustical_xml::{EnumVariants, PropName, XmlDeserialize, XmlSerialize};
|
||||
|
||||
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Clone, PropName, EnumVariants)]
|
||||
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Eq, Clone, PropName, EnumVariants)]
|
||||
#[xml(unit_variants_ident = "DavPushExtensionPropName")]
|
||||
pub enum DavPushExtensionProp {
|
||||
// WebDav Push
|
||||
@@ -32,7 +32,7 @@ pub trait DavPushExtension {
|
||||
) -> Result<DavPushExtensionProp, rustical_dav::Error> {
|
||||
Ok(match &prop {
|
||||
DavPushExtensionPropName::Transports => {
|
||||
DavPushExtensionProp::Transports(Default::default())
|
||||
DavPushExtensionProp::Transports(Transports::default())
|
||||
}
|
||||
DavPushExtensionPropName::Topic => DavPushExtensionProp::Topic(self.get_topic()),
|
||||
DavPushExtensionPropName::SupportedTriggers => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#![warn(clippy::all, clippy::pedantic, clippy::nursery)]
|
||||
#![allow(clippy::missing_errors_doc)]
|
||||
mod extension;
|
||||
mod prop;
|
||||
pub mod register;
|
||||
@@ -69,6 +70,7 @@ impl<S: SubscriptionStore> DavPushController<S> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::cognitive_complexity)]
|
||||
async fn send_message(&self, message: CollectionOperation) {
|
||||
let subscriptions = match self.sub_store.get_subscriptions(&message.topic).await {
|
||||
Ok(subs) => subs,
|
||||
|
||||
@@ -7,7 +7,7 @@ pub enum Transport {
|
||||
WebPush,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, XmlSerialize, PartialEq)]
|
||||
#[derive(Debug, Clone, XmlSerialize, PartialEq, Eq)]
|
||||
pub struct Transports {
|
||||
#[xml(flatten, ty = "untagged")]
|
||||
#[xml(ns = "crate::namespace::NS_DAVPUSH")]
|
||||
@@ -22,10 +22,10 @@ impl Default for Transports {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(XmlSerialize, XmlDeserialize, PartialEq, Clone)]
|
||||
#[derive(XmlSerialize, XmlDeserialize, PartialEq, Eq, Clone)]
|
||||
pub struct SupportedTriggers(#[xml(flatten, ty = "untagged")] pub Vec<Trigger>);
|
||||
|
||||
#[derive(XmlSerialize, XmlDeserialize, PartialEq, Debug, Clone)]
|
||||
#[derive(XmlSerialize, XmlDeserialize, PartialEq, Eq, Debug, Clone)]
|
||||
pub enum Trigger {
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAVPUSH")]
|
||||
ContentUpdate(ContentUpdate),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::Trigger;
|
||||
use rustical_xml::{XmlDeserialize, XmlRootTag, XmlSerialize};
|
||||
|
||||
#[derive(XmlDeserialize, Clone, Debug, PartialEq)]
|
||||
#[derive(XmlDeserialize, Clone, Debug, PartialEq, Eq)]
|
||||
#[xml(ns = "crate::namespace::NS_DAVPUSH")]
|
||||
pub struct WebPushSubscription {
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAVPUSH")]
|
||||
@@ -23,16 +23,16 @@ pub struct SubscriptionPublicKey {
|
||||
pub key: String,
|
||||
}
|
||||
|
||||
#[derive(XmlDeserialize, Clone, Debug, PartialEq)]
|
||||
#[derive(XmlDeserialize, Clone, Debug, PartialEq, Eq)]
|
||||
pub struct SubscriptionElement {
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAVPUSH")]
|
||||
pub web_push_subscription: WebPushSubscription,
|
||||
}
|
||||
|
||||
#[derive(XmlDeserialize, XmlSerialize, Clone, Debug, PartialEq)]
|
||||
#[derive(XmlDeserialize, XmlSerialize, Clone, Debug, PartialEq, Eq)]
|
||||
pub struct TriggerElement(#[xml(ty = "untagged", flatten)] Vec<Trigger>);
|
||||
|
||||
#[derive(XmlDeserialize, XmlRootTag, Clone, Debug, PartialEq)]
|
||||
#[derive(XmlDeserialize, XmlRootTag, Clone, Debug, PartialEq, Eq)]
|
||||
#[xml(root = "push-register")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAVPUSH")]
|
||||
pub struct PushRegister {
|
||||
@@ -100,6 +100,6 @@ mod tests {
|
||||
Trigger::PropertyUpdate(PropertyUpdate(Depth::Zero)),
|
||||
]))
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user