feat: Remove the hashbrown dependency for library users

This commit is contained in:
Clément Renault 2019-02-03 12:22:50 +01:00
parent 06d5a10902
commit 87f0d8cf3c
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE
6 changed files with 21 additions and 21 deletions

View File

@ -1,13 +1,13 @@
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
use std::collections::{HashMap, HashSet};
use std::io::{self, BufRead, BufReader};
use std::path::{Path, PathBuf};
use std::error::Error;
use std::borrow::Cow;
use std::fs::File;
use hashbrown::{HashMap, HashSet};
use serde_derive::{Serialize, Deserialize};
use structopt::StructOpt;

View File

@ -1,7 +1,7 @@
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
use log::{error, info};
use std::collections::{HashMap, HashSet};
use std::error::Error;
use std::ffi::OsStr;
use std::fmt;
@ -12,19 +12,15 @@ use std::path::{PathBuf, Path};
use std::sync::Arc;
use std::time::SystemTime;
use hashbrown::{HashMap, HashSet};
use chashmap::CHashMap;
use chashmap::ReadGuard;
use chashmap::{CHashMap, ReadGuard};
use elapsed::measure_time;
use meilidb::database::Database;
use meilidb::database::UpdateBuilder;
use meilidb::database::schema::Schema;
use meilidb::database::schema::SchemaBuilder;
use meilidb::database::{Database, UpdateBuilder};
use meilidb::database::schema::{Schema, SchemaBuilder};
use meilidb::tokenizer::DefaultBuilder;
use serde_derive::Deserialize;
use serde_derive::Serialize;
use serde_derive::{Serialize, Deserialize};
use structopt::StructOpt;
use warp::{Rejection, Filter};
use log::{error, info};
#[derive(Debug, StructOpt)]
pub struct Opt {

View File

@ -189,17 +189,18 @@ impl Database {
#[cfg(test)]
mod tests {
use super::*;
use std::collections::HashSet;
use std::error::Error;
use serde_derive::{Serialize, Deserialize};
use hashbrown::HashSet;
use tempfile::tempdir;
use crate::database::schema::{SchemaBuilder, STORED, INDEXED};
use crate::database::update::UpdateBuilder;
use crate::tokenizer::DefaultBuilder;
use super::*;
#[test]
fn ingest_one_update_file() -> Result<(), Box<Error>> {
let dir = tempdir()?;
@ -367,7 +368,7 @@ mod tests {
mod bench {
extern crate test;
use super::*;
use std::collections::HashSet;
use std::error::Error;
use std::iter::repeat_with;
use self::test::Bencher;
@ -377,12 +378,13 @@ mod bench {
use rand::{Rng, SeedableRng};
use serde_derive::Serialize;
use rand::seq::SliceRandom;
use hashbrown::HashSet;
use crate::tokenizer::DefaultBuilder;
use crate::database::update::UpdateBuilder;
use crate::database::schema::*;
use super::*;
fn random_sentences<R: Rng>(number: usize, rng: &mut R) -> String {
let mut words = String::new();

View File

@ -1,3 +1,8 @@
use std::collections::HashSet;
use serde::Serialize;
use serde::ser;
use crate::database::update::DocumentUpdate;
use crate::database::serde::SerializerError;
use crate::database::schema::SchemaAttr;
@ -5,10 +10,6 @@ use crate::tokenizer::TokenizerBuilder;
use crate::tokenizer::Token;
use crate::{DocumentId, DocIndex};
use hashbrown::HashSet;
use serde::Serialize;
use serde::ser;
pub struct IndexerSerializer<'a, B> {
pub tokenizer_builder: &'a B,
pub update: &'a mut DocumentUpdate,

View File

@ -1,4 +1,5 @@
use hashbrown::HashSet;
use std::collections::HashSet;
use serde::Serialize;
use serde::ser;

View File

@ -1,7 +1,7 @@
use std::collections::HashSet;
use std::path::PathBuf;
use std::error::Error;
use hashbrown::HashSet;
use serde::Serialize;
use crate::database::serde::serializer::Serializer;