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
+5 -1
View File
@@ -215,7 +215,11 @@ pub fn read_exact_at(
/// storage. For structures whose size is only known once their prefix has
/// been parsed and whose parsers bound-check what they are given.
#[inline]
pub fn read_upto(file: &dyn Storage, offset: u64, max: usize) -> Result<Cow<'_, [u8]>, FormatError> {
pub fn read_upto(
file: &dyn Storage,
offset: u64,
max: usize,
) -> Result<Cow<'_, [u8]>, FormatError> {
let avail = file.len().saturating_sub(offset);
let len = usize::try_from(avail).map_or(max, |a| a.min(max));
let bytes = file.read_at(offset, len)?;