mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-25 22:34:28 +01:00
remove unused stuff in global.rs
This commit is contained in:
parent
ff38f29981
commit
4ed195426c
@ -3,7 +3,6 @@ use std::sync::RwLock;
|
||||
|
||||
use super::metadata::{FieldIdMapWithMetadata, Metadata};
|
||||
use super::MutFieldIdMapper;
|
||||
use crate::documents::FieldIdMapper;
|
||||
use crate::FieldId;
|
||||
|
||||
/// A fields ids map that can be globally updated to add fields
|
||||
@ -14,22 +13,12 @@ pub struct GlobalFieldsIdsMap<'indexing> {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct LocalFieldsIdsMap {
|
||||
struct LocalFieldsIdsMap {
|
||||
names_ids: BTreeMap<String, FieldId>,
|
||||
ids_names: BTreeMap<FieldId, String>,
|
||||
metadata: BTreeMap<FieldId, Metadata>,
|
||||
}
|
||||
|
||||
impl FieldIdMapper for LocalFieldsIdsMap {
|
||||
fn id(&self, name: &str) -> Option<FieldId> {
|
||||
self.id(name)
|
||||
}
|
||||
|
||||
fn name(&self, id: FieldId) -> Option<&str> {
|
||||
self.name(id)
|
||||
}
|
||||
}
|
||||
|
||||
impl LocalFieldsIdsMap {
|
||||
fn new(global: &RwLock<FieldIdMapWithMetadata>) -> Self {
|
||||
let global = global.read().unwrap();
|
||||
@ -116,10 +105,6 @@ impl<'indexing> GlobalFieldsIdsMap<'indexing> {
|
||||
|
||||
self.local.name(id)
|
||||
}
|
||||
|
||||
pub fn local_map(&self) -> &LocalFieldsIdsMap {
|
||||
&self.local
|
||||
}
|
||||
}
|
||||
|
||||
impl<'indexing> MutFieldIdMapper for GlobalFieldsIdsMap<'indexing> {
|
||||
|
Loading…
Reference in New Issue
Block a user