Skip to content

Commit e551a9e

Browse files
committed
Update lib.rs
1 parent e14ef71 commit e551a9e

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/lib.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,33 +56,33 @@
5656
//! }
5757
//! }
5858
//!
59-
// !fn main() { block_on(async move {
60-
// ! // Create a client (without sending any request so that can't fail)
61-
// ! let client = Client::new("http://localhost:7700", "masterKey");
62-
// !
63-
// ! // Get the index called "movies"
64-
// ! let movies = client.get_or_create("movies").await.unwrap();
65-
// !
66-
// ! // Add some movies in the index
67-
// ! movies.add_documents(&[
68-
// ! Movie{id: 1, title: String::from("Carol"), genres: vec!["Romance", "Drama"]},
69-
// ! Movie{id: 2, title: String::from("Wonder Woman"), genres: vec!["Action", "Adventure"]},
70-
// ! Movie{id: 3, title: String::from("Life of Pi"), genres: vec!["Adventure", "Drama"]},
71-
// ! Movie{id: 4, title: String::from("Mad Max"), genres: vec!["Adventure", "Science Fiction"]},
72-
// ! Movie{id: 5, title: String::from("Moana"), genres: vec!["Fantasy", "Action"]},
73-
// ! Movie{id: 6, title: String::from("Philadelphia"), genres: vec!["Drama"]},
74-
// ! ], Some("id")).await.unwrap();
75-
// !
76-
// ! // Query movies (note that there is a typo)
77-
// ! println!("{:?}", movies.search().with_query("Carol").execute::<Movie>().await.unwrap().hits);
78-
// !})}
79-
// !```
80-
// !
81-
// !Output:
82-
// !
83-
// !```
84-
// ![Movie{id: 1, title: String::from("Carol"), genres: vec!["Romance", "Drama"]}]
85-
// !```
59+
//! fn main() { block_on(async move {
60+
//! // Create a client (without sending any request so that can't fail)
61+
//! let client = Client::new("http://localhost:7700", "masterKey");
62+
//!
63+
//! // Get the index called "movies"
64+
//! let movies = client.get_or_create("movies").await.unwrap();
65+
//!
66+
//! // Add some movies in the index
67+
//! movies.add_documents(&[
68+
//! Movie{id: 1, title: String::from("Carol"), genres: vec!["Romance", "Drama"]},
69+
//! Movie{id: 2, title: String::from("Wonder Woman"), genres: vec!["Action", "Adventure"]},
70+
//! Movie{id: 3, title: String::from("Life of Pi"), genres: vec!["Adventure", "Drama"]},
71+
//! Movie{id: 4, title: String::from("Mad Max"), genres: vec!["Adventure", "Science Fiction"]},
72+
//! Movie{id: 5, title: String::from("Moana"), genres: vec!["Fantasy", "Action"]},
73+
//! Movie{id: 6, title: String::from("Philadelphia"), genres: vec!["Drama"]},
74+
//! ], Some("id")).await.unwrap();
75+
//!
76+
//! // Query movies (note that there is a typo)
77+
//! println!("{:?}", movies.search().with_query("carol").execute::<Movie>().await.unwrap().hits);
78+
//! })}
79+
//! ```
80+
//!
81+
//! Output:
82+
//!
83+
//! ```text
84+
//! [Movie{id: 1, title: String::from("Carol"), genres: vec!["Romance", "Drama"]}]
85+
//! ```
8686
//!
8787
//! ## 🌐 Running in the Browser with WASM <!-- omit in TOC -->
8888
//!

0 commit comments

Comments
 (0)