fix: resolve clippy warnings in share_link, invite_code, asset_stack

This commit is contained in:
2026-05-31 04:27:03 +02:00
parent 51fa62fdef
commit 2b62d1ec81
3 changed files with 9 additions and 17 deletions

View File

@@ -37,7 +37,7 @@ pub struct AssetStack {
impl AssetStack { impl AssetStack {
pub fn new(stack_type: StackType, primary_asset_id: SystemId, owner: SystemId) -> Self { pub fn new(stack_type: StackType, primary_asset_id: SystemId, owner: SystemId) -> Self {
let primary_member = AssetStackMember { let primary_member = AssetStackMember {
asset_id: primary_asset_id.clone(), asset_id: primary_asset_id,
role: StackMemberRole::PrimaryDisplay, role: StackMemberRole::PrimaryDisplay,
sort_order: 0, sort_order: 0,
}; };

View File

@@ -26,15 +26,11 @@ impl InviteCode {
} }
pub fn is_valid(&self) -> bool { pub fn is_valid(&self) -> bool {
if let Some(exp) = &self.expires_at { if self.expires_at.is_some_and(|exp| exp.as_datetime() < &Utc::now()) {
if exp.as_datetime() < &Utc::now() { return false;
return false;
}
} }
if let Some(max) = self.max_uses { if self.max_uses.is_some_and(|max| self.use_count >= max) {
if self.use_count >= max { return false;
return false;
}
} }
true true
} }

View File

@@ -35,15 +35,11 @@ impl ShareLink {
if !self.is_active { if !self.is_active {
return false; return false;
} }
if let Some(exp) = &self.expires_at { if self.expires_at.is_some_and(|exp| exp.as_datetime() < &Utc::now()) {
if exp.as_datetime() < &Utc::now() { return false;
return false;
}
} }
if let Some(max) = self.max_uses { if self.max_uses.is_some_and(|max| self.use_count >= max) {
if self.use_count >= max { return false;
return false;
}
} }
true true
} }