Skip to content

Commit 315fbc3

Browse files
committed
update the README
1 parent 8f7ec25 commit 315fbc3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ struct Movie {
108108
}
109109

110110

111-
fn main() { block_on(async move {
111+
#[tokio::main(flavor = "current_thread")]
112+
async fn main() {
112113
// Create a client (without sending any request so that can't fail)
113114
let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));
114115

@@ -124,7 +125,7 @@ fn main() { block_on(async move {
124125
Movie { id: 5, title: String::from("Moana"), genres: vec!["Fantasy".to_string(), "Action".to_string()] },
125126
Movie { id: 6, title: String::from("Philadelphia"), genres: vec!["Drama".to_string()] },
126127
], Some("id")).await.unwrap();
127-
})}
128+
}
128129
```
129130

130131
With the `uid`, you can check the status (`enqueued`, `canceled`, `processing`, `succeeded` or `failed`) of your documents addition using the [task](https://www.meilisearch.com/docs/reference/api/tasks#get-task).
@@ -238,11 +239,11 @@ Json output:
238239
}
239240
```
240241

241-
#### Using users customized HttpClient <!-- omit in TOC -->
242+
#### Customize the `HttpClient` <!-- omit in TOC -->
242243

243-
If you want to change the `HttpClient` you can incorporate using the `Client::new_with_client` method.
244-
To use it, you need to implement the `HttpClient Trait`(`isahc` is used by default).
245-
There are [using-reqwest-example](./examples/cli-app-with-reqwest) of using `reqwest`.
244+
By default, the SDK uses [`reqwest`](https://docs.rs/reqwest/latest/reqwest/) to make http calls.
245+
The SDK lets you customize the http client by implementing the `HttpClient` trait yourself and
246+
initializing the `Client` with the `new_with_client` method.
246247

247248
## 🌐 Running in the Browser with WASM <!-- omit in TOC -->
248249

0 commit comments

Comments
 (0)