fix: resolve clippy warnings in share_link, invite_code, asset_stack
This commit is contained in:
@@ -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,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user