From 2844cb5bca66df410cd2ee9b1603e0477c74db02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Fri, 10 May 2019 12:05:19 +0200 Subject: [PATCH] fix: Make the examples compile --- meilidb-data/src/database.rs | 4 ++++ meilidb/examples/create-database.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/meilidb-data/src/database.rs b/meilidb-data/src/database.rs index 1a5a94048..de48961f3 100644 --- a/meilidb-data/src/database.rs +++ b/meilidb-data/src/database.rs @@ -464,6 +464,10 @@ impl Index { self.0.lease() } + pub fn schema(&self) -> Schema { + self.0.lease().schema.clone() + } + pub fn documents_addition(&self) -> DocumentsAddition { let ranked_map = self.0.lease().ranked_map.clone(); DocumentsAddition::new(self, ranked_map) diff --git a/meilidb/examples/create-database.rs b/meilidb/examples/create-database.rs index b0bfa1127..8fbbe368a 100644 --- a/meilidb/examples/create-database.rs +++ b/meilidb/examples/create-database.rs @@ -52,7 +52,7 @@ fn index( { let database = Database::start_default(database_path)?; - let index = database.create_index("default".to_string(), schema.clone())?; + let index = database.create_index("default", schema.clone())?; let mut rdr = csv::Reader::from_path(csv_data_path)?; let mut raw_record = csv::StringRecord::new();