Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
NoodleSamaChan committed Apr 21, 2024
1 parent 01bcdf5 commit 699c6a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 4 additions & 2 deletions meilisearch-index-setting-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ fn get_index_config_implementation(
get_settings_token_for_list(&filterable_attributes, "with_filterable_attributes");
let searchable_attr_tokens =
get_settings_token_for_list(&searchable_attributes, "with_searchable_attributes");
let distinct_attr_token =
get_settings_token_for_string_for_some_string(&distinct_key_attribute, "with_distinct_attribute");
let distinct_attr_token = get_settings_token_for_string_for_some_string(
&distinct_key_attribute,
"with_distinct_attribute",
);

quote! {
#[::meilisearch_sdk::macro_helper::async_trait(?Send)]
Expand Down
15 changes: 7 additions & 8 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,18 @@ impl Settings {
}

#[must_use]
pub fn with_distinct_attribute(self, distinct_attribute: Option< impl AsRef<str>>) -> Settings {
pub fn with_distinct_attribute(self, distinct_attribute: Option<impl AsRef<str>>) -> Settings {
if let Some(distinct_attribute) = distinct_attribute {
Settings {
Settings {
distinct_attribute: Some(Some(distinct_attribute.as_ref().to_string())),
..self
}
} else {
Settings {
}
} else {
Settings {
distinct_attribute: Some(None),
..self
}

}
}
}
}

#[must_use]
Expand Down

0 comments on commit 699c6a0

Please sign in to comment.