From e74f04ad0df92640581d34f04975f3c6d10574d2 Mon Sep 17 00:00:00 2001 From: Brooks Date: Tue, 23 Jan 2024 14:48:30 -0500 Subject: [PATCH] Replaces fs-err in snapshot_utils.rs (#34908) --- runtime/src/snapshot_utils.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 879dcaa6c..ff0afc1e7 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -13,7 +13,6 @@ use { bzip2::bufread::BzDecoder, crossbeam_channel::Sender, flate2::read::GzDecoder, - fs_err, lazy_static::lazy_static, log::*, regex::Regex, @@ -1069,7 +1068,7 @@ fn serialize_snapshot_data_file_capped( where F: FnOnce(&mut BufWriter) -> Result<()>, { - let data_file = fs_err::File::create(data_file_path)?.into(); + let data_file = fs::File::create(data_file_path)?; let mut data_file_stream = BufWriter::new(data_file); serializer(&mut data_file_stream)?; data_file_stream.flush()?; @@ -1140,7 +1139,7 @@ fn create_snapshot_data_file_stream( snapshot_root_file_path: impl AsRef, maximum_file_size: u64, ) -> Result<(u64, BufReader)> { - let snapshot_file_size = fs_err::metadata(&snapshot_root_file_path)?.len(); + let snapshot_file_size = fs::metadata(&snapshot_root_file_path)?.len(); if snapshot_file_size > maximum_file_size { let error_message = format!( @@ -1152,8 +1151,8 @@ fn create_snapshot_data_file_stream( return Err(IoError::other(error_message).into()); } - let snapshot_data_file = fs_err::File::open(snapshot_root_file_path.as_ref())?; - let snapshot_data_file_stream = BufReader::new(snapshot_data_file.into()); + let snapshot_data_file = fs::File::open(snapshot_root_file_path)?; + let snapshot_data_file_stream = BufReader::new(snapshot_data_file); Ok((snapshot_file_size, snapshot_data_file_stream)) } @@ -1436,16 +1435,16 @@ fn create_snapshot_meta_files_for_unarchived_snapshot(unpack_dir: impl AsRef