Don't append .index to core name autmatically

The array of string passed to load() is now full file names instead of
Core / dataset names.
This commit is contained in:
2019-10-04 19:10:49 +02:00
parent 57e2710915
commit e4a1959fc7
2 changed files with 2 additions and 4 deletions

View File

@@ -138,9 +138,7 @@ impl DataBase {
} }
pub fn load_core(name: &str) -> Result<(Vec<Space>, Core), String> { pub fn load_core(name: &str) -> Result<(Vec<Space>, Core), String> {
let fn_index = format!("{}.index", name); let mmap = DataBase::mmap_file(&name)?;
let mmap = DataBase::mmap_file(&fn_index)?;
match bincode::deserialize(&mmap[..]) { match bincode::deserialize(&mmap[..]) {
Err(e) => Err(format!("Index deserialization error: {:?}", e)), Err(e) => Err(format!("Index deserialization error: {:?}", e)),

View File

@@ -29,7 +29,7 @@ fn main() {
let db; let db;
{ {
info_time!("Loading database index"); info_time!("Loading database index");
db = DataBase::load(&["10k"]).unwrap(); db = DataBase::load(&["10k.index"]).unwrap();
} }
if true { if true {