run clippy fix

This commit is contained in:
Lennart K
2025-10-27 19:01:04 +01:00
parent 08041c60be
commit 0d071d3b92
94 changed files with 455 additions and 484 deletions

View File

@@ -23,7 +23,7 @@ impl<AP: AuthenticationProvider> Clone for AuthenticationLayer<AP> {
}
impl<AP: AuthenticationProvider> AuthenticationLayer<AP> {
pub fn new(auth_provider: Arc<AP>) -> Self {
pub const fn new(auth_provider: Arc<AP>) -> Self {
Self { auth_provider }
}
}

View File

@@ -35,7 +35,7 @@ impl Principal {
/// Returns true if the user is either
/// - the principal itself
/// - has full access to the prinicpal (is member)
pub fn is_principal(&self, principal: &str) -> bool {
#[must_use] pub fn is_principal(&self, principal: &str) -> bool {
if self.id == principal {
return true;
}

View File

@@ -3,8 +3,8 @@ use std::fmt::Display;
use rustical_xml::ValueSerialize;
use serde::{Deserialize, Serialize};
/// https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.3
#[derive(Debug, Clone, Deserialize, Serialize, Default, PartialEq, clap::ValueEnum)]
/// <https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.3>
#[derive(Debug, Clone, Deserialize, Serialize, Default, PartialEq, Eq, clap::ValueEnum)]
#[serde(rename_all = "lowercase")]
pub enum PrincipalType {
#[default]
@@ -36,13 +36,13 @@ impl TryFrom<&str> for PrincipalType {
}
impl PrincipalType {
pub fn as_str(&self) -> &'static str {
#[must_use] pub const fn as_str(&self) -> &'static str {
match self {
PrincipalType::Individual => "INDIVIDUAL",
PrincipalType::Group => "GROUP",
PrincipalType::Resource => "RESOURCE",
PrincipalType::Room => "ROOM",
PrincipalType::Unknown => "UNKNOWN",
Self::Individual => "INDIVIDUAL",
Self::Group => "GROUP",
Self::Resource => "RESOURCE",
Self::Room => "ROOM",
Self::Unknown => "UNKNOWN",
}
}
}