From 07f41628db5d5d16ed4c1aa8b0afeb28e1f08c1c Mon Sep 17 00:00:00 2001 From: apfitzge Date: Tue, 19 Jul 2022 18:15:41 -0500 Subject: [PATCH] untar_snapshot_create_shared_buffer doesn't need to return a result (#26686) --- runtime/src/snapshot_utils.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 99b68a2a75..602df50dd9 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -1531,9 +1531,9 @@ fn unpack_snapshot_local( fn untar_snapshot_create_shared_buffer( snapshot_tar: &Path, archive_format: ArchiveFormat, -) -> Result { +) -> SharedBuffer { let open_file = || File::open(&snapshot_tar).unwrap(); - Ok(match archive_format { + match archive_format { ArchiveFormat::TarBzip2 => SharedBuffer::new(BzDecoder::new(BufReader::new(open_file()))), ArchiveFormat::TarGzip => SharedBuffer::new(GzDecoder::new(BufReader::new(open_file()))), ArchiveFormat::TarZstd => SharedBuffer::new( @@ -1543,7 +1543,7 @@ fn untar_snapshot_create_shared_buffer( SharedBuffer::new(lz4::Decoder::new(BufReader::new(open_file())).unwrap()) } ArchiveFormat::Tar => SharedBuffer::new(BufReader::new(open_file())), - }) + } } fn untar_snapshot_in>( @@ -1553,7 +1553,7 @@ fn untar_snapshot_in>( archive_format: ArchiveFormat, parallel_divisions: usize, ) -> Result { - let shared_buffer = untar_snapshot_create_shared_buffer(snapshot_tar.as_ref(), archive_format)?; + let shared_buffer = untar_snapshot_create_shared_buffer(snapshot_tar.as_ref(), archive_format); unpack_snapshot_local(shared_buffer, unpack_dir, account_paths, parallel_divisions) }