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