feat: Remove lazy_static's sync overhead

This commit is contained in:
Kerollmops
2018-05-05 13:50:51 +02:00
committed by Clément Renault
parent 2ffb140963
commit 7fba62fc22
5 changed files with 26 additions and 42 deletions

View File

@ -5,7 +5,7 @@ extern crate serde;
mod fst_map;
use std::ops::{Range, Deref, DerefMut};
use std::ops::Range;
use std::io::{Write, BufReader};
use std::fs::File;
use std::path::Path;
@ -20,20 +20,6 @@ pub struct StreamBuilder<'a, T: 'a, A: Automaton> {
values: &'a Values<T>,
}
impl<'a, T, A: Automaton> Deref for StreamBuilder<'a, T, A> {
type Target = fst::map::StreamBuilder<'a, A>;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a, T, A: Automaton> DerefMut for StreamBuilder<'a, T, A> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a, T: 'a, A: Automaton> fst::IntoStreamer<'a> for StreamBuilder<'a, T, A> {
type Item = (&'a str, &'a [T]);