mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-03-18 21:58:20 +01:00
Call the underlying Env::copy_to_path method
This commit is contained in:
parent
7e07cb9de1
commit
1af520077c
@ -1,7 +1,6 @@
|
||||
use std::borrow::Cow;
|
||||
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
|
||||
use std::fs::File;
|
||||
use std::io::Seek;
|
||||
use std::path::Path;
|
||||
|
||||
use heed::{types::*, WithoutTls};
|
||||
@ -346,11 +345,7 @@ impl Index {
|
||||
}
|
||||
|
||||
pub fn copy_to_path<P: AsRef<Path>>(&self, path: P, option: CompactionOption) -> Result<File> {
|
||||
let mut file =
|
||||
File::options().create(true).write(true).truncate(true).read(true).open(path)?;
|
||||
self.copy_to_file(&mut file, option)?;
|
||||
file.rewind()?;
|
||||
Ok(file)
|
||||
self.env.copy_to_path(path, option).map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Returns an `EnvClosingEvent` that can be used to wait for the closing event,
|
||||
|
Loading…
x
Reference in New Issue
Block a user