feat: Remove the Schema to/from_toml/json/bin methods

This commit is contained in:
Clément Renault
2019-09-16 14:48:33 +02:00
parent ffc29a319f
commit 35b7b58ff7
4 changed files with 15 additions and 61 deletions

View File

@ -13,8 +13,8 @@ meilidb-schema = { path = "../meilidb-schema", version = "0.1.0" }
csv = "1.0.7"
diskus = "0.5.0"
env_logger = "0.6.1"
jemallocator = "0.1.9"
indexmap = { version = "1.1.0", features = ["serde-1"] }
jemallocator = "0.1.9"
meilidb-core = { path = "../meilidb-core", version = "0.1.0" }
quickcheck = "0.8.2"
rand = "0.6.5"
@ -26,3 +26,4 @@ structopt = "0.2.15"
sysinfo = "0.8.4"
tempfile = "3.0.7"
termcolor = "1.0.4"
toml = "0.5.3"

View File

@ -6,7 +6,7 @@ use std::io::{self, BufRead, BufReader};
use std::path::{Path, PathBuf};
use std::time::Instant;
use std::error::Error;
use std::fs::File;
use std::fs::{self, File};
use diskus::Walk;
use sysinfo::{SystemExt, ProcessExt};
@ -181,8 +181,8 @@ fn main() -> Result<(), Box<dyn Error>> {
let opt = Opt::from_args();
let schema = {
let file = File::open(&opt.schema_path)?;
Schema::from_toml(file)?
let string = fs::read_to_string(&opt.schema_path)?;
toml::from_str(&string)?
};
let stop_words = match opt.stop_words {