diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 539157a14..898c1038e 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -249,8 +249,7 @@ impl Storage { .join(&remote_index_path); if local_index_path.exists() { - let mut file = fs::File::open(local_index_path)?; - archive_index::Index::load(&mut file) + archive_index::Index::load(io::BufReader::new(fs::File::open(local_index_path)?)) } else { let index_content = self.get(&remote_index_path, std::usize::MAX)?.content;