chore: rustfmt the workspace and make clippy -D warnings pass

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 19:19:21 +07:00
parent d7fe99edd7
commit f13f0e6953
46 changed files with 6606 additions and 1496 deletions

View File

@@ -26,9 +26,9 @@ pub fn contiguous_from_zero(ranges: &[ByteRange]) -> u64 {
}
pub fn write_at(file: &mut File, offset: u64, data: &[u8], total: u64) -> io::Result<ByteRange> {
let end = offset.checked_add(data.len() as u64).ok_or_else(|| {
io::Error::new(io::ErrorKind::InvalidInput, "chunk offset overflows")
})?;
let end = offset
.checked_add(data.len() as u64)
.ok_or_else(|| io::Error::new(io::ErrorKind::InvalidInput, "chunk offset overflows"))?;
if end > total {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
@@ -47,10 +47,7 @@ mod tests {
#[test]
fn out_of_order_chunks_cover_the_object() {
assert_eq!(
contiguous_from_zero(&[ByteRange { start: 4, end: 8 }]),
0
);
assert_eq!(contiguous_from_zero(&[ByteRange { start: 4, end: 8 }]), 0);
assert_eq!(
contiguous_from_zero(&[
ByteRange { start: 4, end: 8 },