mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-24 21:50:07 +01:00
chore: implement deref on CommonIndex
This commit is contained in:
parent
6ed97d1c19
commit
e3c413759f
@ -1,3 +1,4 @@
|
||||
use std::ops::Deref;
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::Serialize;
|
||||
use super::Error;
|
||||
@ -6,6 +7,14 @@ use std::marker::PhantomData;
|
||||
#[derive(Clone)]
|
||||
pub struct CommonIndex(pub crate::CfTree);
|
||||
|
||||
impl Deref for CommonIndex {
|
||||
type Target = crate::CfTree;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl CommonIndex {
|
||||
pub fn get<T, K>(&self, key: K) -> Result<Option<T>, Error>
|
||||
where T: DeserializeOwned,
|
||||
|
Loading…
x
Reference in New Issue
Block a user