mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 09:04:59 +08:00
refactor: Rewrite another method chain to be more readable
This commit is contained in:
parent
2db738dbac
commit
e0d24104a3
@ -478,13 +478,8 @@ impl<'a, 't, 'u, 'i> Settings<'a, 't, 'u, 'i> {
|
|||||||
fn update_exact_attributes(&mut self) -> Result<bool> {
|
fn update_exact_attributes(&mut self) -> Result<bool> {
|
||||||
match self.exact_attributes {
|
match self.exact_attributes {
|
||||||
Setting::Set(ref attrs) => {
|
Setting::Set(ref attrs) => {
|
||||||
let old_attrs = self
|
let old_attrs = self.index.exact_attributes(self.wtxn)?;
|
||||||
.index
|
let old_attrs = old_attrs.into_iter().map(String::from).collect::<HashSet<_>>();
|
||||||
.exact_attributes(self.wtxn)?
|
|
||||||
.iter()
|
|
||||||
.cloned()
|
|
||||||
.map(String::from)
|
|
||||||
.collect::<HashSet<String>>();
|
|
||||||
|
|
||||||
if attrs != &old_attrs {
|
if attrs != &old_attrs {
|
||||||
let attrs = attrs.iter().map(String::as_str).collect::<Vec<_>>();
|
let attrs = attrs.iter().map(String::as_str).collect::<Vec<_>>();
|
||||||
|
Loading…
Reference in New Issue
Block a user