Skip to content

Commit 3516519

Browse files
committed
A bit of housekeeping
1 parent 61dc8ff commit 3516519

File tree

25 files changed

+101
-107
lines changed

25 files changed

+101
-107
lines changed

.code-samples.meilisearch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This code-samples file is used by the Meilisearch documentation
22
# Every example written here will be automatically fetched by
33
# the documentation on build
4-
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
4+
# You can read more on https://github.com/meilisearch/documentation/tree/main/learn
55
---
66
synonyms_guide_1: |-
77
let mut synonyms = std::collections::HashMap::new();

.github/scripts/check-release.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/bin/sh
22

33
# Checking if current tag matches the package version
4-
current_tag=$(echo $GITHUB_REF | cut -d '/' -f 3 | sed -r 's/^v//')
5-
major=$(echo $current_tag | cut -d '.' -f1)
6-
minor=$(echo $current_tag | cut -d '.' -f2)
4+
current_tag=$(echo "$GITHUB_REF" | cut -d '/' -f 3 | sed -r 's/^v//')
75

86
file1='Cargo.toml'
97
file2='README.tpl'

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ curl -L https://install.meilisearch.com | sh # download Meilisearch
5353
cargo test
5454
```
5555

56-
There is two kind of tests, documentation tests and unit tests.
56+
There are two kinds of tests, documentation tests and unit tests.
5757
If you need to write or read the unit tests you should consider reading this
5858
[readme](meilisearch-test-macro/README.md) about our custom testing macro.
5959

@@ -91,13 +91,13 @@ rustup update
9191

9292
Each PR should pass the format test to be accepted.
9393

94-
Run the following to fix the formating errors:
94+
Run the following to fix the formatting errors:
9595

9696
```
9797
cargo fmt
9898
```
9999

100-
and the following to test if the formating is correct:
100+
and the following to test if the formatting is correct:
101101
```
102102
cargo fmt --all -- --check
103103
```
@@ -139,7 +139,7 @@ We do not enforce any branch naming style, but please use something descriptive
139139

140140
As minimal requirements, your commit message should:
141141
- be capitalized
142-
- not finish by a dot or any other punctuation character (!,?)
142+
- not finished by a dot or any other punctuation character (!,?)
143143
- start with a verb so that we can read your commit message this way: "This commit will ...", where "..." is the commit message.
144144
e.g.: "Fix the home page button" or "Add more tests for create_index method"
145145

@@ -171,7 +171,7 @@ _[Read more about this](https://github.com/meilisearch/integration-guides/blob/m
171171

172172
### How to Publish the Release <!-- omit in toc -->
173173

174-
⚠️ Before doing anything, make sure you got through the guide about [Releasing an Integration](https://github.com/meilisearch/integration-guides/blob/main/resources/integration-release.md).
174+
⚠️ Before doing anything, make sure you get through the guide about [Releasing an Integration](https://github.com/meilisearch/integration-guides/blob/main/resources/integration-release.md).
175175

176176
Make a PR modifying the file [`Cargo.toml`](/Cargo.toml):
177177

@@ -212,4 +212,4 @@ GitHub Actions will be triggered and push the package to [crates.io](https://cra
212212

213213
<hr>
214214

215-
Thank you again for reading this through. We can not wait to begin to work with you if you make your way through this contributing guide ❤️
215+
Thank you again for reading this through. We cannot wait to begin to work with you if you make your way through this contributing guide ❤️

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
- [⚡ Supercharge your Meilisearch experience](#-supercharge-your-meilisearch-experience)
3939
- [🔧 Installation](#-installation)
4040
- [🚀 Getting started](#-getting-started)
41-
- [🌐 Running in the Browser with WASM](#-running-in-the-browser-with-wasm)
41+
- [🌐 Running in the Browser with WASM](#-running-in-the-browser-with-wasm-)
4242
- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch)
43-
- [⚙️ Contributing](#-contributing)
43+
- [⚙️ Contributing](#-contributing)
4444

4545
## 📖 Documentation
4646

examples/cli-app/assets/clothes.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
11
[
22
{
33
"id": 1,
4-
"seaon": "winter",
4+
"season": "winter",
55
"article": "sweater",
66
"cost": 63.40,
77
"size":"L",
88
"pattern":"striped"
99
},
1010
{
1111
"id": 2,
12-
"seaon": "spring",
12+
"season": "spring",
1313
"article": "sweat pants",
1414
"cost": 18.00,
1515
"size":"XXXL",
1616
"pattern":"floral"
1717
},
1818
{
1919
"id": 3,
20-
"seaon": "fall",
20+
"season": "fall",
2121
"article": "t-shirt",
2222
"cost": 1634.90,
2323
"size":"M",
2424
"pattern":"solid black"
2525
},
2626
{
2727
"id": 4,
28-
"seaon": "summer",
28+
"season": "summer",
2929
"article": "tank top",
3030
"cost": 3.40,
3131
"size":"L",
3232
"pattern":"diagonal"
3333
},
3434
{
3535
"id": 5,
36-
"seaon": "winter",
36+
"season": "winter",
3737
"article": "jeans",
3838
"cost": 4.20,
3939
"size":"XL",
4040
"pattern":"striped"
4141
},
4242
{
4343
"id": 6,
44-
"seaon": "spring",
44+
"season": "spring",
4545
"article": "sun dress",
4646
"cost": 12634.56,
4747
"size":"L",
4848
"pattern":"floral"
4949
},
5050
{
5151
"id": 7,
52-
"seaon": "fall",
52+
"season": "fall",
5353
"article": "sweatshirt",
5454
"cost": 90.80,
5555
"size":"M",
5656
"pattern":"checker"
5757
},
5858
{
5959
"id": 8,
60-
"seaon": "summer",
60+
"season": "summer",
6161
"article": "shorts",
6262
"cost": 16.34,
6363
"size":"XS",
6464
"pattern":"solid beige"
6565
},
6666
{
6767
"id": 9,
68-
"seaon": "winter",
68+
"season": "winter",
6969
"article": "jacket",
7070
"cost": 634,
7171
"size":"L",
7272
"pattern":"camo"
7373
}
74-
]
74+
]

examples/cli-app/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn main() {
3838
}
3939

4040
async fn search(query: &str) {
41-
// make the search query, which excutes and serializes hits into the
41+
// make the search query, which executes and serializes hits into the
4242
// ClothesDisplay struct
4343
let query_results = CLIENT
4444
.index("clothes")
@@ -74,7 +74,7 @@ async fn build_index() {
7474
let ranking_rules = ["words", "typo", "attribute", "exactness", "cost:asc"];
7575

7676
// create searchable attributes
77-
let searchable_attributes = ["seaon", "article", "size", "pattern"];
77+
let searchable_attributes = ["season", "article", "size", "pattern"];
7878

7979
// create the synonyms hashmap
8080
let mut synonyms = std::collections::HashMap::new();
@@ -128,7 +128,7 @@ async fn build_index() {
128128
#[derive(Serialize, Deserialize, Debug)]
129129
pub struct Clothes {
130130
id: usize,
131-
seaon: String,
131+
season: String,
132132
article: String,
133133
cost: f32,
134134
size: String,

examples/web_app/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ fn header_content(processing_time_ms: usize, link: &Scope<Model>) -> Html {
147147
{"We wrote a blog post about "}<a href="https://blog.meilisearch.com/meili-finds-rust-crates/">{"how we made this search engine available for you"}</a>{"."}<br/>
148148
{"What you are currently using is not the original front end, but a clone using "}<a href="https://github.com/meilisearch/meilisearch-rust">{"the Meilisearch Rust SDK"}</a>{" and "}<a href="https://yew.rs">{"Yew"}</a>{". The code is available "}<a href="https://github.com/meilisearch/meilisearch-rust/tree/main/examples/web_app">{"here"}</a>{"."}<br/>
149149
{"The whole design was taken from "}<a href="https://lib.rs">{"lib.rs"}</a>{" because we love it."}<br/>
150-
<br/>{"We pull new crates and crates updates every "}<em>{"10 minutes"}</em>{" from "}<a href="https://docs.rs/releases">{"docs.rs"}</a>{" and all the downloads counts "}<em>{"every day at 3:30 PM UTC"}</em>{" from "}<a href="https://crates.io/data-access">{"crates.io"}</a>{". Currently we have something like "}<em>{" 31 729 crates"}</em>{"."}<br/>
150+
<br/>{"We pull new crates and crates update every "}<em>{"10 minutes"}</em>{" from "}<a href="https://docs.rs/releases">{"docs.rs"}</a>{" and all the downloads count "}<em>{"every day at 3:30 PM UTC"}</em>{" from "}<a href="https://crates.io/data-access">{"crates.io"}</a>{". Currently we have something like "}<em>{" 31 729 crates"}</em>{"."}<br/>
151151
<br/>{"Have fun using it "}<img draggable="false" class="emoji" alt="⌨️" src="moz-extension://57a82bfe-3134-4c34-bdb1-bc4ada430e6c/data/components/twemoji/svg/2328.svg"/>{" "}<img draggable="false" class="emoji" alt="💨" src="moz-extension://57a82bfe-3134-4c34-bdb1-bc4ada430e6c/data/components/twemoji/svg/1f4a8.svg"/><br/>
152152
</p>
153153
<form role="search" id="search">

meilisearch-index-setting-macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "meilisearch-index-setting-macro"
33
version = "0.24.3"
4-
description = "Helper tool to generate settings of an Meilisearch index"
4+
description = "Helper tool to generate settings of a Meilisearch index"
55
edition = "2021"
66
license = "MIT"
77

meilisearch-index-setting-macro/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use convert_case::{Case, Casing};
22
use proc_macro2::Ident;
33
use quote::quote;
4-
use structmeta::Flag;
5-
use structmeta::StructMeta;
6-
use syn::parse_macro_input;
7-
use syn::spanned::Spanned;
4+
use structmeta::{Flag, StructMeta};
5+
use syn::{parse_macro_input, spanned::Spanned};
86

97
#[derive(Clone, StructMeta, Default)]
108
struct FieldAttrs {
@@ -162,7 +160,7 @@ fn get_settings_token_for_list(
162160
#attr
163161
}
164162
});
165-
let method_ident = syn::Ident::new(method_name, proc_macro2::Span::call_site());
163+
let method_ident = Ident::new(method_name, proc_macro2::Span::call_site());
166164

167165
if !field_name_list.is_empty() {
168166
quote! {
@@ -179,7 +177,7 @@ fn get_settings_token_for_string(
179177
field_name: &String,
180178
method_name: &str,
181179
) -> proc_macro2::TokenStream {
182-
let method_ident = syn::Ident::new(method_name, proc_macro2::Span::call_site());
180+
let method_ident = Ident::new(method_name, proc_macro2::Span::call_site());
183181

184182
if !field_name.is_empty() {
185183
quote! {

meilisearch-test-macro/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ pub fn meilisearch_test(params: TokenStream, input: TokenStream) -> TokenStream
9696
// Now we do the same for the index name
9797
if use_name {
9898
let fn_name = &outer_fn.sig.ident;
99-
// the name we're going to return is the complete path to the function ie something like that;
99+
// the name we're going to return is the complete path to the function i.e., something like that;
100100
// `indexes::tests::test_fetch_info` but since the `::` are not allowed by meilisearch as an index
101101
// name we're going to rename that to `indexes-tests-test_fetch_info`.
102102
outer_block.push(parse_quote!(
103103
let name = format!("{}::{}", std::module_path!(), stringify!(#fn_name)).replace("::", "-");
104104
));
105105
}
106106

107-
//And finally if an index was asked we delete it, and we (re)create it and wait until meilisearch confirm its creation.
107+
// And finally if an index was asked, we delete it, and we (re)create it and wait until meilisearch confirm its creation.
108108
if use_index {
109109
outer_block.push(parse_quote!({
110110
let res = client
@@ -160,7 +160,7 @@ pub fn meilisearch_test(params: TokenStream, input: TokenStream) -> TokenStream
160160
.delete()
161161
.await
162162
.expect("Network issue while sending the last delete index task");
163-
// we early exit the test here and let meilisearch handle the deletion asynchonously
163+
// we early exit the test here and let meilisearch handle the deletion asynchronously
164164
));
165165
}
166166

scripts/check-readme.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ fi
1212
cargo install cargo-readme
1313

1414
# Comparing the generated README and the current one
15-
curent_readme="README.md"
15+
current_readme="README.md"
1616
generated_readme="README.md_tmp"
1717
cargo readme > "$generated_readme"
1818

1919
# Exiting with the right message
2020
echo ''
21-
diff "$curent_readme" "$generated_readme" > /dev/null 2>&1
21+
diff "$current_readme" "$generated_readme" > /dev/null 2>&1
2222
if [ "$?" = 0 ]; then
2323
echo "OK"
2424
rm -f "$generated_readme"
@@ -29,7 +29,7 @@ else
2929
# Displaying the diff if the --diff flag is activated
3030
if [ "$1" = '--diff' ]; then
3131
echo 'Diff found:'
32-
diff "$curent_readme" "$generated_readme"
32+
diff "$current_readme" "$generated_readme"
3333
else
3434
echo 'To see the diff, run:'
3535
echo ' $ sh scripts/check-readme.sh --diff'

scripts/update_macro_versions.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/sh
2-
new_version=$(cat Cargo.toml | grep '^version = ')
2+
new_version=$(grep '^version = ' Cargo.toml)
33

44
# Updates the versions in meilisearch-rust and meilisearch-index-setting-macro of the latter, with the latest meilisearch-rust version.
55

6-
old_index_macro_version=$(cat ./meilisearch-index-setting-macro/Cargo.toml | grep '^version = ')
7-
old_macro_in_sdk_version=$(cat ./Cargo.toml | grep '{ path = "meilisearch-index-setting-macro", version =')
6+
old_index_macro_version=$(grep '^version = ' ./meilisearch-index-setting-macro/Cargo.toml)
7+
old_macro_in_sdk_version=$(grep '{ path = "meilisearch-index-setting-macro", version =' ./Cargo.toml)
88

99
sed -i '' -e "s/^$old_index_macro_version/$new_version/g" './meilisearch-index-setting-macro/Cargo.toml'
1010
sed -i '' -e "s/$old_macro_in_sdk_version/meilisearch-index-setting-macro = { path = \"meilisearch-index-setting-macro\", $new_version }/g" './Cargo.toml'

src/client.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Client {
4141
pub fn new(host: impl Into<String>, api_key: Option<impl Into<String>>) -> Client {
4242
Client {
4343
host: host.into(),
44-
api_key: api_key.map(std::convert::Into::into),
44+
api_key: api_key.map(Into::into),
4545
}
4646
}
4747

@@ -150,7 +150,7 @@ impl Client {
150150
self.api_key.as_deref()
151151
}
152152

153-
/// List all [Indexes](Index) with query parameters and returns values as instances of [Index].
153+
/// List all [Indexes](Index) with query parameters and return values as instances of [Index].
154154
///
155155
/// # Example
156156
///
@@ -1021,18 +1021,18 @@ impl Client {
10211021
/// # let MEILISEARCH_API_KEY = option_env!("MEILISEARCH_API_KEY").unwrap_or("masterKey");
10221022
/// #
10231023
/// # futures::executor::block_on(async move {
1024-
/// # let client = client::Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));
1024+
/// # let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));
10251025
/// let api_key_uid = "76cf8b87-fd12-4688-ad34-260d930ca4f4".to_string();
10261026
/// let token = client.generate_tenant_token(api_key_uid, serde_json::json!(["*"]), None, None).unwrap();
10271027
///
1028-
/// let client = client::Client::new(MEILISEARCH_URL, Some(token));
1028+
/// let client = Client::new(MEILISEARCH_URL, Some(token));
10291029
/// # });
10301030
/// ```
10311031
#[cfg(not(target_arch = "wasm32"))]
10321032
pub fn generate_tenant_token(
10331033
&self,
10341034
api_key_uid: String,
1035-
search_rules: serde_json::Value,
1035+
search_rules: Value,
10361036
api_key: Option<&str>,
10371037
expires_at: Option<OffsetDateTime>,
10381038
) -> Result<String, Error> {
@@ -1235,15 +1235,15 @@ mod tests {
12351235
#[meilisearch_test]
12361236
async fn test_get_tasks(client: Client) {
12371237
let tasks = client.get_tasks().await.unwrap();
1238-
assert!(tasks.limit == 20);
1238+
assert_eq!(tasks.limit, 20);
12391239
}
12401240

12411241
#[meilisearch_test]
12421242
async fn test_get_tasks_with_params(client: Client) {
12431243
let query = TasksSearchQuery::new(&client);
12441244
let tasks = client.get_tasks_with(&query).await.unwrap();
12451245

1246-
assert!(tasks.limit == 20);
1246+
assert_eq!(tasks.limit, 20);
12471247
}
12481248

12491249
#[meilisearch_test]
@@ -1329,7 +1329,7 @@ mod tests {
13291329

13301330
assert_eq!(key.actions, vec![Action::DocumentsAdd]);
13311331
assert_eq!(&key.name, &Some(name));
1332-
// We can't compare the two timestamp directly because of some nanoseconds imprecision with the floats
1332+
// We can't compare the two timestamps directly because of some nanoseconds imprecision with the floats
13331333
assert_eq!(
13341334
key.expires_at.unwrap().unix_timestamp(),
13351335
expires_at.unix_timestamp()

0 commit comments

Comments
 (0)