style fixes

This commit is contained in:
mpostma 2020-05-27 12:04:35 +02:00
parent d9e2e1a177
commit 05344043b2
13 changed files with 51 additions and 56 deletions

View file

@ -7,10 +7,10 @@ use meilisearch_core::update;
use serde::Deserialize;
use serde_json::Value;
use crate::Data;
use crate::error::{Error, ResponseError};
use crate::helpers::Authentication;
use crate::routes::{IndexParam, IndexUpdateResponse};
use crate::Data;
type Document = IndexMap<String, Value>;
@ -192,7 +192,7 @@ async fn update_multiple_documents(
let update_id = data
.db
.update_write::<_, _, ResponseError>(move |writer| {
.update_write::<_, _, ResponseError>(|writer| {
let update_id = document_addition.finalize(writer)?;
Ok(update_id)
})?;

View file

@ -24,6 +24,7 @@ async fn set_healthy(data: web::Data<Data>) -> Result<HttpResponse, ResponseErro
data.db.set_healthy(writer)?;
Ok(())
})?;
Ok(HttpResponse::Ok().finish())
}
@ -32,6 +33,7 @@ async fn set_unhealthy(data: web::Data<Data>) -> Result<HttpResponse, ResponseEr
data.db.set_unhealthy(writer)?;
Ok(())
})?;
Ok(HttpResponse::Ok().finish())
}

View file

@ -65,11 +65,11 @@ async fn get_all(
let stop_words: BTreeSet<String> = index
.main
.stop_words_list(&reader)?
.stop_words(&reader)?
.into_iter()
.collect();
let synonyms_list = index.main.synonyms_list(&reader)?;
let synonyms_list = index.main.synonyms(&reader)?;
let mut synonyms = BTreeMap::new();
let index_synonyms = &index.synonyms;

View file

@ -25,7 +25,7 @@ async fn get(
.open_index(&path.index_uid)
.ok_or(Error::index_not_found(&path.index_uid))?;
let reader = data.db.main_read_txn()?;
let stop_words = index.main.stop_words_list(&reader)?;
let stop_words = index.main.stop_words(&reader)?;
Ok(HttpResponse::Ok().json(stop_words))
}

View file

@ -29,7 +29,7 @@ async fn get(
let reader = data.db.main_read_txn()?;
let synonyms_list = index.main.synonyms_list(&reader)?;
let synonyms_list = index.main.synonyms(&reader)?;
let mut synonyms = IndexMap::new();
let index_synonyms = &index.synonyms;