Skip to content

Commit bb4826f

Browse files
committed
Lint
1 parent e0776dd commit bb4826f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

storage/src/nodestore/persist.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ impl NodeStore<Committed, FileBacked> {
231231
node.persist_at(persisted_address);
232232

233233
// Decrement gauge immediately after node is written to storage
234+
#[expect(clippy::cast_possible_truncation)]
234235
gauge!("firewood.nodes.unwritten").decrement(1.0);
235236

236237
// Move the arc to a vector of persisted nodes for caching
@@ -307,7 +308,7 @@ impl NodeStore<Committed, FileBacked> {
307308
completion_queue: io_uring::cqueue::CompletionQueue<'_>,
308309
saved_pinned_buffers: &mut [PinnedBufferEntry],
309310
) -> Result<usize, FileIoError> {
310-
let mut completed_count = 0;
311+
let mut completed_count = 0usize;
311312
for entry in completion_queue {
312313
let item = entry.user_data() as usize;
313314
let pbe = saved_pinned_buffers
@@ -333,7 +334,7 @@ impl NodeStore<Committed, FileBacked> {
333334
));
334335
}
335336
pbe.offset = None;
336-
completed_count += 1;
337+
completed_count = completed_count.wrapping_add(1);
337338
}
338339
Ok(completed_count)
339340
}
@@ -424,6 +425,7 @@ impl NodeStore<Committed, FileBacked> {
424425

425426
// Decrement gauge for writes that have actually completed
426427
if completed_writes > 0 {
428+
#[expect(clippy::cast_possible_truncation)]
427429
gauge!("firewood.nodes.unwritten").decrement(completed_writes as f64);
428430
}
429431
}
@@ -446,6 +448,7 @@ impl NodeStore<Committed, FileBacked> {
446448

447449
// Decrement gauge for final batch of writes that completed
448450
if final_completed_writes > 0 {
451+
#[expect(clippy::cast_possible_truncation)]
449452
gauge!("firewood.nodes.unwritten").decrement(final_completed_writes as f64);
450453
}
451454

0 commit comments

Comments
 (0)