mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-23 19:49:26 +00:00
run clippy fix
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user