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 {
|
||||
pub fn new(stack_type: StackType, primary_asset_id: SystemId, owner: SystemId) -> Self {
|
||||
let primary_member = AssetStackMember {
|
||||
asset_id: primary_asset_id.clone(),
|
||||
asset_id: primary_asset_id,
|
||||
role: StackMemberRole::PrimaryDisplay,
|
||||
sort_order: 0,
|
||||
};
|
||||
|
||||
@@ -26,15 +26,11 @@ impl InviteCode {
|
||||
}
|
||||
|
||||
pub fn is_valid(&self) -> bool {
|
||||
if let Some(exp) = &self.expires_at {
|
||||
if exp.as_datetime() < &Utc::now() {
|
||||
return false;
|
||||
}
|
||||
if self.expires_at.is_some_and(|exp| exp.as_datetime() < &Utc::now()) {
|
||||
return false;
|
||||
}
|
||||
if let Some(max) = self.max_uses {
|
||||
if self.use_count >= max {
|
||||
return false;
|
||||
}
|
||||
if self.max_uses.is_some_and(|max| self.use_count >= max) {
|
||||
return false;
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
@@ -35,15 +35,11 @@ impl ShareLink {
|
||||
if !self.is_active {
|
||||
return false;
|
||||
}
|
||||
if let Some(exp) = &self.expires_at {
|
||||
if exp.as_datetime() < &Utc::now() {
|
||||
return false;
|
||||
}
|
||||
if self.expires_at.is_some_and(|exp| exp.as_datetime() < &Utc::now()) {
|
||||
return false;
|
||||
}
|
||||
if let Some(max) = self.max_uses {
|
||||
if self.use_count >= max {
|
||||
return false;
|
||||
}
|
||||
if self.max_uses.is_some_and(|max| self.use_count >= max) {
|
||||
return false;
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user