treewide: format with nightly rustfmt; auto-fix Clippy lints

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If4fd0511087dbaa65afc56a34d7c2f166a6a6964
This commit is contained in:
raf 2026-02-08 21:18:42 +03:00
commit 3a03cf7b3e
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
26 changed files with 222 additions and 161 deletions

View file

@ -49,19 +49,19 @@ pub const VALID_PROJECT_ROLES: &[&str] = &[
];
/// Check if a global role is valid
#[must_use]
#[must_use]
pub fn is_valid_role(role: &str) -> bool {
VALID_ROLES.contains(&role)
}
/// Check if a project role is valid
#[must_use]
#[must_use]
pub fn is_valid_project_role(role: &str) -> bool {
VALID_PROJECT_ROLES.contains(&role)
}
/// Get the highest project role (for permission checks)
#[must_use]
#[must_use]
pub fn project_role_level(role: &str) -> i32 {
match role {
PROJECT_ROLE_ADMIN => 3,
@ -73,7 +73,7 @@ pub fn project_role_level(role: &str) -> i32 {
/// Check if user has required project permission
/// Higher level roles automatically have lower level permissions
#[must_use]
#[must_use]
pub fn has_project_permission(user_role: &str, required: &str) -> bool {
let user_level = project_role_level(user_role);
let required_level = project_role_level(required);