From 1af520077c5c1f4f1edfa8581e78304fc3dd03b6 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 13 Mar 2025 11:49:25 +0100 Subject: [PATCH] Call the underlying Env::copy_to_path method --- crates/milli/src/index.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/milli/src/index.rs b/crates/milli/src/index.rs index e5eab9bb0..771d32175 100644 --- a/crates/milli/src/index.rs +++ b/crates/milli/src/index.rs @@ -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>(&self, path: P, option: CompactionOption) -> Result { - 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,