@@ -143,13 +143,13 @@ struct SearchResult {
143143async fn get_search_results (
144144 conn : & mut sqlx:: PgConnection ,
145145 registry : & RegistryApi ,
146- query_params : Option < & str > ,
146+ query_params : & str ,
147147) -> Result < SearchResult , anyhow:: Error > {
148148 let crate :: registry_api:: Search {
149149 crates,
150150 meta,
151151 executed_query,
152- } = registry. get_crates ( query_params) . await ?;
152+ } = registry. search ( query_params) . await ?;
153153
154154 let names = Arc :: new (
155155 crates
@@ -602,15 +602,15 @@ pub(crate) async fn search_handler(
602602 sort_by = v;
603603 } ;
604604
605- get_search_results ( & mut conn, & registry, Some ( query_params) ) . await ?
605+ get_search_results ( & mut conn, & registry, query_params) . await ?
606606 } else if !query. is_empty ( ) {
607607 let query_params: String = form_urlencoded:: Serializer :: new ( String :: new ( ) )
608608 . append_pair ( "q" , & query)
609609 . append_pair ( "sort" , & sort_by)
610610 . append_pair ( "per_page" , & RELEASES_IN_RELEASES . to_string ( ) )
611611 . finish ( ) ;
612612
613- get_search_results ( & mut conn, & registry, Some ( & query_params) ) . await ?
613+ get_search_results ( & mut conn, & registry, & query_params) . await ?
614614 } else {
615615 return Err ( AxumNope :: NoResults ) ;
616616 } ;
0 commit comments