From a8d339c9e77f410aa97c08bf1fdb241cfd0fceaf Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 16 Apr 2026 10:07:36 +0200 Subject: [PATCH] block: vhd: Remove catch all in physical_size boundary FixedVhd::physical_size() can only return Error::GetFileMetadata. Replace the catch-all arm with unreachable!() so future error variants are not silently mapped to a generic Io classification. Signed-off-by: Anatol Belski --- block/src/fixed_vhd_async.rs | 2 +- block/src/fixed_vhd_sync.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/src/fixed_vhd_async.rs b/block/src/fixed_vhd_async.rs index 699fb2a49..d54670315 100644 --- a/block/src/fixed_vhd_async.rs +++ b/block/src/fixed_vhd_async.rs @@ -36,7 +36,7 @@ impl disk_file::PhysicalSize for FixedVhdDiskAsync { crate::Error::GetFileMetadata(io) => { BlockError::new(BlockErrorKind::Io, crate::Error::GetFileMetadata(io)) } - _ => BlockError::new(BlockErrorKind::Io, e), + _ => unreachable!("unexpected error from FixedVhd::physical_size(): {e}"), }) } } diff --git a/block/src/fixed_vhd_sync.rs b/block/src/fixed_vhd_sync.rs index 14685522b..877b17c1d 100644 --- a/block/src/fixed_vhd_sync.rs +++ b/block/src/fixed_vhd_sync.rs @@ -36,7 +36,7 @@ impl disk_file::PhysicalSize for FixedVhdDiskSync { crate::Error::GetFileMetadata(io) => { BlockError::new(BlockErrorKind::Io, crate::Error::GetFileMetadata(io)) } - _ => BlockError::new(BlockErrorKind::Io, e), + _ => unreachable!("unexpected error from FixedVhd::physical_size(): {e}"), }) } }