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:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user