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

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(),
}
}