@@ -137,7 +137,7 @@ pub async fn handle_get_raid_leaderboard(
137137 meta : PaginationMetadata {
138138 page : params. page ,
139139 page_size : params. page_size ,
140- total_items : total_items as u32 ,
140+ total_items,
141141 total_pages,
142142 } ,
143143 } ;
@@ -151,9 +151,9 @@ pub async fn handle_get_specific_raider_raid_leaderboard(
151151 Path ( ( raider_id, raid_id) ) : Path < ( String , i32 ) > ,
152152) -> Result < Json < SuccessResponse < RaidLeaderboard > > , AppError > {
153153 let Some ( raider_leaderboard) = state. db . raid_leaderboards . get_raider_entry ( raid_id, & raider_id) . await ? else {
154- return Err ( AppError :: Database ( DbError :: RecordNotFound ( format ! (
155- "No raider leaderboard is found"
156- ) ) ) ) ;
154+ return Err ( AppError :: Database ( DbError :: RecordNotFound (
155+ "No raider leaderboard is found" . to_string ( ) ,
156+ ) ) ) ;
157157 } ;
158158
159159 Ok ( SuccessResponse :: new ( raider_leaderboard) )
@@ -189,13 +189,13 @@ pub async fn handle_create_raid_submission(
189189 let ( current_active_raid, user_x) = get_active_raid_and_x_association ( & state, & user) . await ?;
190190
191191 let Some ( ( reply_username, reply_id) ) = parse_x_status_url ( & payload. tweet_reply_link ) else {
192- return Err ( AppError :: Handler ( HandlerError :: InvalidBody ( format ! (
193- "Couldn't parse tweet reply link"
194- ) ) ) ) ;
192+ return Err ( AppError :: Handler ( HandlerError :: InvalidBody (
193+ "Couldn't parse tweet reply link" . to_string ( ) ,
194+ ) ) ) ;
195195 } ;
196196 if user_x. username != reply_username {
197197 return Err ( AppError :: Handler ( HandlerError :: Auth ( AuthHandlerError :: Unauthorized (
198- format ! ( "Only tweet reply author is eligible to submit" ) ,
198+ "Only tweet reply author is eligible to submit" . to_string ( ) ,
199199 ) ) ) ) ;
200200 }
201201
@@ -224,7 +224,7 @@ pub async fn handle_delete_raid_submission(
224224
225225 if raid_submission. raider_id != user. quan_address . 0 {
226226 return Err ( AppError :: Handler ( HandlerError :: Auth ( AuthHandlerError :: Unauthorized (
227- format ! ( "Only raid submission owner can delete" ) ,
227+ "Only raid submission owner can delete" . to_string ( ) ,
228228 ) ) ) ) ;
229229 }
230230
@@ -238,14 +238,14 @@ async fn get_active_raid_and_x_association(
238238 user : & Address ,
239239) -> Result < ( RaidQuest , XAssociation ) , AppError > {
240240 let Some ( current_active_raid) = state. db . raid_quests . find_active ( ) . await ? else {
241- return Err ( AppError :: Database ( DbError :: RecordNotFound ( format ! (
242- "No active raid is found"
243- ) ) ) ) ;
241+ return Err ( AppError :: Database ( DbError :: RecordNotFound (
242+ "No active raid is found" . to_string ( ) ,
243+ ) ) ) ;
244244 } ;
245245 let Some ( user_x) = state. db . x_associations . find_by_address ( & user. quan_address ) . await ? else {
246- return Err ( AppError :: Database ( DbError :: RecordNotFound ( format ! (
247- "User doesn't have X association"
248- ) ) ) ) ;
246+ return Err ( AppError :: Database ( DbError :: RecordNotFound (
247+ "User doesn't have X association" . to_string ( ) ,
248+ ) ) ) ;
249249 } ;
250250 Ok ( ( current_active_raid, user_x) )
251251}
@@ -369,7 +369,7 @@ mod tests {
369369 . oneshot (
370370 Request :: builder ( )
371371 . method ( "PUT" )
372- . uri ( & format ! ( "/raids/{}/finish" , raid_id) )
372+ . uri ( format ! ( "/raids/{}/finish" , raid_id) )
373373 . body ( Body :: empty ( ) )
374374 . unwrap ( ) ,
375375 )
@@ -405,7 +405,7 @@ mod tests {
405405 . oneshot (
406406 Request :: builder ( )
407407 . method ( "PUT" )
408- . uri ( & format ! ( "/raids/{}/activate" , raid_id) )
408+ . uri ( format ! ( "/raids/{}/activate" , raid_id) )
409409 . body ( Body :: empty ( ) )
410410 . unwrap ( ) ,
411411 )
@@ -514,7 +514,7 @@ mod tests {
514514 . oneshot (
515515 Request :: builder ( )
516516 . method ( "GET" )
517- . uri ( & format ! ( "/raiders/{}/leaderboard/{}" , user. quan_address. 0 , raid_id, ) )
517+ . uri ( format ! ( "/raiders/{}/leaderboard/{}" , user. quan_address. 0 , raid_id, ) )
518518 . body ( Body :: empty ( ) )
519519 . unwrap ( ) ,
520520 )
@@ -707,7 +707,7 @@ mod tests {
707707 . oneshot (
708708 Request :: builder ( )
709709 . method ( "DELETE" )
710- . uri ( & format ! ( "/submissions/{}" , submission_id) )
710+ . uri ( format ! ( "/submissions/{}" , submission_id) )
711711 . body ( Body :: empty ( ) )
712712 . unwrap ( ) ,
713713 )
@@ -756,7 +756,7 @@ mod tests {
756756 . oneshot (
757757 Request :: builder ( )
758758 . method ( "DELETE" )
759- . uri ( & format ! ( "/submissions/{}" , submission_id) )
759+ . uri ( format ! ( "/submissions/{}" , submission_id) )
760760 . body ( Body :: empty ( ) )
761761 . unwrap ( ) ,
762762 )
0 commit comments