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

@@ -41,13 +41,13 @@ impl XmlSerialize for UserPrivilegeSet {
}
}
#[derive(Debug, Clone, Default, PartialEq)]
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct UserPrivilegeSet {
privileges: HashSet<UserPrivilege>,
}
impl UserPrivilegeSet {
pub fn has(&self, privilege: &UserPrivilege) -> bool {
#[must_use] pub fn has(&self, privilege: &UserPrivilege) -> bool {
if (privilege == &UserPrivilege::WriteProperties
|| privilege == &UserPrivilege::WriteContent)
&& self.privileges.contains(&UserPrivilege::Write)
@@ -57,13 +57,13 @@ impl UserPrivilegeSet {
self.privileges.contains(privilege) || self.privileges.contains(&UserPrivilege::All)
}
pub fn all() -> Self {
#[must_use] pub fn all() -> Self {
Self {
privileges: HashSet::from([UserPrivilege::All]),
}
}
pub fn owner_only(is_owner: bool) -> Self {
#[must_use] pub fn owner_only(is_owner: bool) -> Self {
if is_owner {
Self::all()
} else {
@@ -71,7 +71,7 @@ impl UserPrivilegeSet {
}
}
pub fn owner_read(is_owner: bool) -> Self {
#[must_use] pub fn owner_read(is_owner: bool) -> Self {
if is_owner {
Self::read_only()
} else {
@@ -79,7 +79,7 @@ impl UserPrivilegeSet {
}
}
pub fn owner_write_properties(is_owner: bool) -> Self {
#[must_use] pub fn owner_write_properties(is_owner: bool) -> Self {
// Content is read-only but we can write properties
if is_owner {
Self::write_properties()
@@ -88,7 +88,7 @@ impl UserPrivilegeSet {
}
}
pub fn read_only() -> Self {
#[must_use] pub fn read_only() -> Self {
Self {
privileges: HashSet::from([
UserPrivilege::Read,
@@ -98,7 +98,7 @@ impl UserPrivilegeSet {
}
}
pub fn write_properties() -> Self {
#[must_use] pub fn write_properties() -> Self {
Self {
privileges: HashSet::from([
UserPrivilege::Read,