File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,13 @@ impl UserLimits {
34
34
WHERE user_id = $1) as collections" ,
35
35
DBUserId :: from( user. id) as DBUserId ,
36
36
)
37
- . fetch_one ( & * pool)
37
+ . fetch_one ( pool)
38
38
. await ?;
39
39
40
40
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 ) ,
44
44
} ;
45
45
46
46
if user. role . is_admin ( ) {
Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ async fn project_create_inner(
352
352
)
353
353
. await ?;
354
354
355
- let limits = UserLimits :: get ( & current_user, & pool) . await ?;
355
+ let limits = UserLimits :: get ( & current_user, pool) . await ?;
356
356
if limits. current . projects + 1 >= limits. max . projects {
357
357
return Err ( CreateError :: LimitReached ) ;
358
358
}
You can’t perform that action at this time.
0 commit comments