Skip to content

Commit f0c7e56

Browse files
committed
chore: fix clippy lints
1 parent 3afa868 commit f0c7e56

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

fvm/src/kernel/blocks.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ pub struct BlockStat {
2929
#[derive(Debug, Clone)]
3030
pub struct Block {
3131
codec: u64,
32+
// Unfortunately, we usually start with a vector/boxed buffer. If we used Rc<[u8]>, we'd have to
33+
// copy the bytes. So we accept some indirection for reliable performance.
34+
#[allow(clippy::redundant_allocation)]
3235
data: Rc<Box<[u8]>>,
3336
}
3437

sdk/src/ipld.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn get_block(id: fvm_shared::sys::BlockId, size_hint: Option<u32>) -> Syscal
5656
remaining = sys::ipld::read(
5757
id,
5858
buf.len() as u32,
59-
buf.as_mut_ptr().offset(buf.len() as isize),
59+
buf.as_mut_ptr_range().end,
6060
(buf.capacity() - buf.len()) as u32,
6161
)?;
6262
debug_assert!(remaining <= 0, "should have read whole block");

0 commit comments

Comments
 (0)