format: rustfmt the Storage conversions
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -385,13 +385,13 @@ impl ObjectHeader {
|
||||
}
|
||||
|
||||
let chunk0_msg_start = pos;
|
||||
let chunk0_msg_end = abs(pos)
|
||||
.checked_add(chunk0_size)
|
||||
.ok_or(FormatError::UnexpectedEof {
|
||||
let Some(chunk0_abs_end) = abs(pos).checked_add(chunk0_size) else {
|
||||
return Err(FormatError::UnexpectedEof {
|
||||
expected: usize::MAX,
|
||||
available: file_len,
|
||||
})?
|
||||
- base;
|
||||
});
|
||||
};
|
||||
let chunk0_msg_end = chunk0_abs_end - base;
|
||||
|
||||
// The whole first chunk, prefix to checksum, in one read (its
|
||||
// bounds check is the one on the checksum's 4 bytes).
|
||||
@@ -1364,7 +1364,11 @@ mod tests {
|
||||
let want = ObjectHeader::parse(&f, at, 8, 8);
|
||||
let storage = CountingStorage::new(f.clone());
|
||||
let got = ObjectHeader::parse_in(&storage, at as u64, 8, 8);
|
||||
assert_eq!(format!("{got:?}"), format!("{want:?}"), "at {at}, cut {cut}");
|
||||
assert_eq!(
|
||||
format!("{got:?}"),
|
||||
format!("{want:?}"),
|
||||
"at {at}, cut {cut}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user