File tree Expand file tree Collapse file tree 1 file changed +8
-20
lines changed Expand file tree Collapse file tree 1 file changed +8
-20
lines changed Original file line number Diff line number Diff line change @@ -338,28 +338,16 @@ pub fn search(req: &mut dyn RequestExt) -> EndpointResult {
338338 )
339339 } ,
340340 )
341- . collect ( ) ;
342-
343- #[ derive( Serialize ) ]
344- struct R {
345- crates : Vec < EncodableCrate > ,
346- meta : Meta ,
347- }
348- #[ derive( Serialize ) ]
349- struct Meta {
350- total : Option < i64 > ,
351- next_page : Option < String > ,
352- prev_page : Option < String > ,
353- }
341+ . collect :: < Vec < _ > > ( ) ;
354342
355- Ok ( req. json ( & R {
356- crates,
357- meta : Meta {
358- total : Some ( total) ,
359- next_page,
360- prev_page,
343+ Ok ( req. json ( & json ! ( {
344+ "crates" : crates,
345+ " meta" : {
346+ " total" : total,
347+ "next_page" : next_page,
348+ "prev_page" : prev_page,
361349 } ,
362- } ) )
350+ } ) ) )
363351}
364352
365353diesel_infix_operator ! ( Contains , "@>" ) ;
You can’t perform that action at this time.
0 commit comments