format: rustfmt the Storage conversions
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -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()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user