From a0caf0d6d77304aa45f716e7ca587e00194b4128 Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Wed, 20 Nov 2019 11:21:21 +0100 Subject: [PATCH] Remove unused result response on indexes_uids function --- meilidb-core/src/database.rs | 4 ++-- meilidb-http/src/routes/index.rs | 3 +-- meilidb-http/src/routes/search.rs | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/meilidb-core/src/database.rs b/meilidb-core/src/database.rs index 0bdde55cb..72e5a1d0f 100644 --- a/meilidb-core/src/database.rs +++ b/meilidb-core/src/database.rs @@ -251,9 +251,9 @@ impl Database { self.env.copy_to_path(path, CompactionOption::Enabled) } - pub fn indexes_uids(&self) -> MResult> { + pub fn indexes_uids(&self) -> Vec { let indexes = self.indexes.read().unwrap(); - Ok(indexes.keys().cloned().collect()) + indexes.keys().cloned().collect() } pub fn common_store(&self) -> heed::PolyDatabase { diff --git a/meilidb-http/src/routes/index.rs b/meilidb-http/src/routes/index.rs index 4eb228f92..f6fe999f2 100644 --- a/meilidb-http/src/routes/index.rs +++ b/meilidb-http/src/routes/index.rs @@ -32,8 +32,7 @@ pub async fn list_indexes(ctx: Context) -> SResult { let indexes_uids = ctx .state() .db - .indexes_uids() - .map_err(ResponseError::internal)?; + .indexes_uids(); let env = &ctx.state().db.env; let mut reader = env.read_txn().map_err(ResponseError::internal)?; diff --git a/meilidb-http/src/routes/search.rs b/meilidb-http/src/routes/search.rs index e4500bc92..0551a278e 100644 --- a/meilidb-http/src/routes/search.rs +++ b/meilidb-http/src/routes/search.rs @@ -159,7 +159,6 @@ pub async fn search_multi_index(mut ctx: Context) -> SResult { .state() .db .indexes_uids() - .map_err(ResponseError::internal)? .into_iter() .collect(); }