From a147c09b068a1948f0be17594d8d4c4df6d0ef73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Fri, 24 May 2019 14:37:04 +0200 Subject: [PATCH] feat: Make more functions accessible on the custom settings --- meilidb-data/src/database/custom_settings.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/meilidb-data/src/database/custom_settings.rs b/meilidb-data/src/database/custom_settings.rs index 7649d2b36..46653bfb0 100644 --- a/meilidb-data/src/database/custom_settings.rs +++ b/meilidb-data/src/database/custom_settings.rs @@ -1,20 +1,13 @@ -use rocksdb::DBVector; +use std::ops::Deref; use crate::database::raw_index::InnerRawIndex; #[derive(Clone)] pub struct CustomSettings(pub(crate) InnerRawIndex); -impl CustomSettings { - pub fn set(&self, key: K, value: V) -> Result<(), rocksdb::Error> - where K: AsRef<[u8]>, - V: AsRef<[u8]>, - { - self.0.set(key, value) - } +impl Deref for CustomSettings { + type Target = InnerRawIndex; - pub fn get(&self, key: K) -> Result, rocksdb::Error> - where K: AsRef<[u8]>, - { - self.0.get(key) + fn deref(&self) -> &Self::Target { + &self.0 } }