@@ -29,7 +29,7 @@ pub struct SwapIndexes {
2929
3030#[ cfg( feature = "isahc" ) ]
3131#[ cfg( not( target_arch = "wasm32" ) ) ]
32- impl Client < IsahcClient > {
32+ impl Client {
3333 /// Create a client using the specified server.
3434 ///
3535 /// Don't put a '/' at the end of the host.
@@ -46,7 +46,7 @@ impl Client<IsahcClient> {
4646 ///
4747 /// let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));
4848 /// ```
49- pub fn new ( host : impl Into < String > , api_key : Option < impl Into < String > > ) -> Client < IsahcClient > {
49+ pub fn new ( host : impl Into < String > , api_key : Option < impl Into < String > > ) -> Client {
5050 Client {
5151 host : host. into ( ) ,
5252 api_key : api_key. map ( |api_key| api_key. into ( ) ) ,
@@ -1211,7 +1211,7 @@ mod tests {
12111211 }
12121212
12131213 #[ meilisearch_test]
1214- async fn test_swapping_two_indexes ( client : Client < IsahcClient > ) {
1214+ async fn test_swapping_two_indexes ( client : Client ) {
12151215 let index_1 = client. index ( "test_swapping_two_indexes_1" ) ;
12161216 let index_2 = client. index ( "test_swapping_two_indexes_2" ) ;
12171217
@@ -1273,7 +1273,7 @@ mod tests {
12731273 . match_header( "User-Agent" , user_agent)
12741274 . create_async( )
12751275 . await ,
1276- client. http_client. clone ( ) . request:: <( ) , ( ) , ( ) >(
1276+ client. http_client. request:: <( ) , ( ) , ( ) >(
12771277 address,
12781278 None ,
12791279 Method :: Get { query: ( ) } ,
@@ -1285,7 +1285,7 @@ mod tests {
12851285 . match_header( "User-Agent" , user_agent)
12861286 . create_async( )
12871287 . await ,
1288- client. http_client. clone ( ) . request:: <( ) , ( ) , ( ) >(
1288+ client. http_client. request:: <( ) , ( ) , ( ) >(
12891289 address,
12901290 None ,
12911291 Method :: Post {
@@ -1300,7 +1300,7 @@ mod tests {
13001300 . match_header( "User-Agent" , user_agent)
13011301 . create_async( )
13021302 . await ,
1303- client. http_client. clone ( ) . request:: <( ) , ( ) , ( ) >(
1303+ client. http_client. request:: <( ) , ( ) , ( ) >(
13041304 address,
13051305 None ,
13061306 Method :: Delete { query: ( ) } ,
@@ -1312,7 +1312,7 @@ mod tests {
13121312 . match_header( "User-Agent" , user_agent)
13131313 . create_async( )
13141314 . await ,
1315- client. http_client. clone ( ) . request:: <( ) , ( ) , ( ) >(
1315+ client. http_client. request:: <( ) , ( ) , ( ) >(
13161316 address,
13171317 None ,
13181318 Method :: Put {
@@ -1327,7 +1327,7 @@ mod tests {
13271327 . match_header( "User-Agent" , user_agent)
13281328 . create_async( )
13291329 . await ,
1330- client. http_client. clone ( ) . request:: <( ) , ( ) , ( ) >(
1330+ client. http_client. request:: <( ) , ( ) , ( ) >(
13311331 address,
13321332 None ,
13331333 Method :: Patch {
@@ -1347,28 +1347,28 @@ mod tests {
13471347 }
13481348
13491349 #[ meilisearch_test]
1350- async fn test_get_tasks ( client : Client < IsahcClient > ) {
1350+ async fn test_get_tasks ( client : Client ) {
13511351 let tasks = client. get_tasks ( ) . await . unwrap ( ) ;
13521352 assert_eq ! ( tasks. limit, 20 ) ;
13531353 }
13541354
13551355 #[ meilisearch_test]
1356- async fn test_get_tasks_with_params ( client : Client < IsahcClient > ) {
1356+ async fn test_get_tasks_with_params ( client : Client ) {
13571357 let query = TasksSearchQuery :: new ( & client) ;
13581358 let tasks = client. get_tasks_with ( & query) . await . unwrap ( ) ;
13591359
13601360 assert_eq ! ( tasks. limit, 20 ) ;
13611361 }
13621362
13631363 #[ meilisearch_test]
1364- async fn test_get_keys ( client : Client < IsahcClient > ) {
1364+ async fn test_get_keys ( client : Client ) {
13651365 let keys = client. get_keys ( ) . await . unwrap ( ) ;
13661366
13671367 assert ! ( keys. results. len( ) >= 2 ) ;
13681368 }
13691369
13701370 #[ meilisearch_test]
1371- async fn test_delete_key ( client : Client < IsahcClient > , name : String ) {
1371+ async fn test_delete_key ( client : Client , name : String ) {
13721372 let mut key = KeyBuilder :: new ( ) ;
13731373 key. with_name ( & name) ;
13741374 let key = client. create_key ( key) . await . unwrap ( ) ;
@@ -1384,7 +1384,7 @@ mod tests {
13841384 }
13851385
13861386 #[ meilisearch_test]
1387- async fn test_error_delete_key ( mut client : Client < IsahcClient > , name : String ) {
1387+ async fn test_error_delete_key ( mut client : Client , name : String ) {
13881388 // ==> accessing a key that does not exist
13891389 let error = client. delete_key ( "invalid_key" ) . await . unwrap_err ( ) ;
13901390 assert ! ( matches!(
@@ -1431,7 +1431,7 @@ mod tests {
14311431 }
14321432
14331433 #[ meilisearch_test]
1434- async fn test_create_key ( client : Client < IsahcClient > , name : String ) {
1434+ async fn test_create_key ( client : Client , name : String ) {
14351435 let expires_at = OffsetDateTime :: now_utc ( ) + time:: Duration :: HOUR ;
14361436 let mut key = KeyBuilder :: new ( ) ;
14371437 key. with_action ( Action :: DocumentsAdd )
@@ -1454,7 +1454,7 @@ mod tests {
14541454 }
14551455
14561456 #[ meilisearch_test]
1457- async fn test_error_create_key ( mut client : Client < IsahcClient > , name : String ) {
1457+ async fn test_error_create_key ( mut client : Client , name : String ) {
14581458 // ==> Invalid index name
14591459 /* TODO: uncomment once meilisearch fix this bug: https://github.com/meilisearch/meilisearch/issues/2158
14601460 let mut key = KeyBuilder::new();
@@ -1500,7 +1500,7 @@ mod tests {
15001500 }
15011501
15021502 #[ meilisearch_test]
1503- async fn test_update_key ( client : Client < IsahcClient > , description : String ) {
1503+ async fn test_update_key ( client : Client , description : String ) {
15041504 let mut key = KeyBuilder :: new ( ) ;
15051505 key. with_name ( "test_update_key" ) ;
15061506 let mut key = client. create_key ( key) . await . unwrap ( ) ;
@@ -1518,7 +1518,7 @@ mod tests {
15181518 }
15191519
15201520 #[ meilisearch_test]
1521- async fn test_get_index ( client : Client < IsahcClient > , index_uid : String ) -> Result < ( ) , Error > {
1521+ async fn test_get_index ( client : Client , index_uid : String ) -> Result < ( ) , Error > {
15221522 let task = client. create_index ( & index_uid, None ) . await ?;
15231523 let index = client
15241524 . wait_for_task ( task, None , None )
@@ -1536,10 +1536,7 @@ mod tests {
15361536 }
15371537
15381538 #[ meilisearch_test]
1539- async fn test_error_create_index (
1540- client : Client < IsahcClient > ,
1541- index : Index < IsahcClient > ,
1542- ) -> Result < ( ) , Error > {
1539+ async fn test_error_create_index ( client : Client , index : Index ) -> Result < ( ) , Error > {
15431540 let error = client
15441541 . create_index ( "Wrong index name" , None )
15451542 . await
@@ -1574,15 +1571,15 @@ mod tests {
15741571 }
15751572
15761573 #[ meilisearch_test]
1577- async fn test_list_all_indexes ( client : Client < IsahcClient > ) {
1574+ async fn test_list_all_indexes ( client : Client ) {
15781575 let all_indexes = client. list_all_indexes ( ) . await . unwrap ( ) ;
15791576
15801577 assert_eq ! ( all_indexes. limit, 20 ) ;
15811578 assert_eq ! ( all_indexes. offset, 0 ) ;
15821579 }
15831580
15841581 #[ meilisearch_test]
1585- async fn test_list_all_indexes_with_params ( client : Client < IsahcClient > ) {
1582+ async fn test_list_all_indexes_with_params ( client : Client ) {
15861583 let mut query = IndexesQuery :: new ( & client) ;
15871584 query. with_limit ( 1 ) ;
15881585 let all_indexes = client. list_all_indexes_with ( & query) . await . unwrap ( ) ;
@@ -1592,15 +1589,15 @@ mod tests {
15921589 }
15931590
15941591 #[ meilisearch_test]
1595- async fn test_list_all_indexes_raw ( client : Client < IsahcClient > ) {
1592+ async fn test_list_all_indexes_raw ( client : Client ) {
15961593 let all_indexes_raw = client. list_all_indexes_raw ( ) . await . unwrap ( ) ;
15971594
15981595 assert_eq ! ( all_indexes_raw[ "limit" ] , json!( 20 ) ) ;
15991596 assert_eq ! ( all_indexes_raw[ "offset" ] , json!( 0 ) ) ;
16001597 }
16011598
16021599 #[ meilisearch_test]
1603- async fn test_list_all_indexes_raw_with_params ( client : Client < IsahcClient > ) {
1600+ async fn test_list_all_indexes_raw_with_params ( client : Client ) {
16041601 let mut query = IndexesQuery :: new ( & client) ;
16051602 query. with_limit ( 1 ) ;
16061603 let all_indexes_raw = client. list_all_indexes_raw_with ( & query) . await . unwrap ( ) ;
@@ -1610,18 +1607,15 @@ mod tests {
16101607 }
16111608
16121609 #[ meilisearch_test]
1613- async fn test_get_primary_key_is_none ( mut index : Index < IsahcClient > ) {
1610+ async fn test_get_primary_key_is_none ( mut index : Index ) {
16141611 let primary_key = index. get_primary_key ( ) . await ;
16151612
16161613 assert ! ( primary_key. is_ok( ) ) ;
16171614 assert ! ( primary_key. unwrap( ) . is_none( ) ) ;
16181615 }
16191616
16201617 #[ meilisearch_test]
1621- async fn test_get_primary_key (
1622- client : Client < IsahcClient > ,
1623- index_uid : String ,
1624- ) -> Result < ( ) , Error > {
1618+ async fn test_get_primary_key ( client : Client , index_uid : String ) -> Result < ( ) , Error > {
16251619 let mut index = client
16261620 . create_index ( index_uid, Some ( "primary_key" ) )
16271621 . await ?
0 commit comments