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
+10 -6
View File
@@ -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}"
);
}
}
}