format: rustfmt the Storage conversions

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-09-26 12:49:05 -05:00
co-authored by Claude Opus 5.5
parent 6a9bb02f37
commit aab7ea9e8f
3 changed files with 27 additions and 10 deletions
+12 -3
View File
@@ -520,7 +520,10 @@ fn image_block_in(
}
/// Where the image block is, checked against a file of `file_len` bytes.
fn image_block_range(file_len: u64, location: CacheImageLocation) -> Result<(u64, usize), FormatError> {
fn image_block_range(
file_len: u64,
location: CacheImageLocation,
) -> Result<(u64, usize), FormatError> {
let bad = FormatError::InvalidCacheImage;
let start = usize::try_from(location.address).map_err(|_| bad("address out of range"))?;
let len = usize::try_from(location.length).map_err(|_| bad("length out of range"))?;
@@ -883,9 +886,15 @@ mod tests {
read_superblock_extension_in(&storage, &sb),
read_superblock_extension(&f, &sb)
);
assert_eq!(cache_image_state_in(&storage, &sb), cache_image_state(&f, &sb));
assert_eq!(
cache_image_state_in(&storage, &sb),
cache_image_state(&f, &sb)
);
if let Ok(CacheImageState::Loaded(image)) = cache_image_state(&f, &sb) {
assert_eq!(&*image.block_in(&storage).unwrap(), image.block(&f).unwrap());
assert_eq!(
&*image.block_in(&storage).unwrap(),
image.block(&f).unwrap()
);
}
}
}