remove unused stuff in global.rs

This commit is contained in:
Louis Dureuil 2024-11-21 15:00:11 +01:00
parent ff38f29981
commit 4ed195426c
No known key found for this signature in database

View File

@ -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> {