setting builder takes ownership

This commit is contained in:
mpostma 2020-12-31 00:50:30 +01:00
parent 12ee7b9b13
commit d1e9ded76f
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A
2 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View File

@ -1588,7 +1588,7 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
[[package]]
name = "meilisearch-error"
version = "0.15.0"
version = "0.17.0"
dependencies = [
"actix-http",
]

View File

@ -216,7 +216,7 @@ impl UpdateHandler {
// We transpose the settings JSON struct into a real setting update.
if let Some(ref names) = settings.searchable_attributes {
match names {
Some(names) => builder.set_searchable_fields(&names),
Some(names) => builder.set_searchable_fields(names.clone()),
None => builder.reset_searchable_fields(),
}
}
@ -224,20 +224,20 @@ impl UpdateHandler {
// We transpose the settings JSON struct into a real setting update.
if let Some(ref names) = settings.displayed_attributes {
match names {
Some(names) => builder.set_displayed_fields(&names),
Some(names) => builder.set_displayed_fields(names.clone()),
None => builder.reset_displayed_fields(),
}
}
// We transpose the settings JSON struct into a real setting update.
if let Some(ref facet_types) = settings.faceted_attributes {
builder.set_faceted_fields(&facet_types);
builder.set_faceted_fields(facet_types.clone());
}
// We transpose the settings JSON struct into a real setting update.
if let Some(ref criteria) = settings.criteria {
match criteria {
Some(criteria) => builder.set_criteria(&criteria),
Some(criteria) => builder.set_criteria(criteria.clone()),
None => builder.reset_criteria(),
}
}