From 77d5dd452fb0e0b95269fb62fa63e60470537fe3 Mon Sep 17 00:00:00 2001 From: mpostma Date: Fri, 12 Mar 2021 14:16:54 +0100 Subject: [PATCH] remove open_or_create --- meilisearch-http/src/index_controller/uuid_resolver.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/meilisearch-http/src/index_controller/uuid_resolver.rs b/meilisearch-http/src/index_controller/uuid_resolver.rs index aa83db2c7..fcf417248 100644 --- a/meilisearch-http/src/index_controller/uuid_resolver.rs +++ b/meilisearch-http/src/index_controller/uuid_resolver.rs @@ -200,13 +200,6 @@ struct HeedUuidStore { db: Database, } -fn open_or_create_database(env: &Env, name: Option<&str>) -> heed::Result> { - match env.open_database(name)? { - Some(db) => Ok(db), - None => env.create_database(name), - } -} - impl HeedUuidStore { fn new(path: impl AsRef) -> anyhow::Result { let path = path.as_ref().join("index_uuids"); @@ -214,7 +207,7 @@ impl HeedUuidStore { let mut options = EnvOpenOptions::new(); options.map_size(1_073_741_824); // 1GB let env = options.open(path)?; - let db = open_or_create_database(&env, None)?; + let db = env.create_database(None)?; Ok(Self { env, db }) } }