Skip to content

Commit 3d74e09

Browse files
committed
Fix clippy
1 parent bbfc06b commit 3d74e09

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apps/labrinth/src/database/models/user_limits.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ impl UserLimits {
3434
WHERE user_id = $1) as collections",
3535
DBUserId::from(user.id) as DBUserId,
3636
)
37-
.fetch_one(&*pool)
37+
.fetch_one(pool)
3838
.await?;
3939

4040
let current = UserLimitCount {
41-
projects: current.projects.map(|x| x as u64).unwrap_or(0),
42-
organizations: current.organizations.map(|x| x as u64).unwrap_or(0),
43-
collections: current.collections.map(|x| x as u64).unwrap_or(0),
41+
projects: current.projects.map_or(0, |x| x as u64),
42+
organizations: current.organizations.map_or(0, |x| x as u64),
43+
collections: current.collections.map_or(0, |x| x as u64),
4444
};
4545

4646
if user.role.is_admin() {

apps/labrinth/src/routes/v3/project_creation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ async fn project_create_inner(
352352
)
353353
.await?;
354354

355-
let limits = UserLimits::get(&current_user, &pool).await?;
355+
let limits = UserLimits::get(&current_user, pool).await?;
356356
if limits.current.projects + 1 >= limits.max.projects {
357357
return Err(CreateError::LimitReached);
358358
}

0 commit comments

Comments
 (0)