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:
@@ -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)),
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user