Skip to content

Commit 0881390

Browse files
committed
remove unnecessary unsafe
1 parent 3325f1c commit 0881390

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drv/auxflash-server/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ impl ServerImpl {
254254
let mut write_addr = spare_slot as usize * SLOT_SIZE;
255255
// SAFETY: this cannot overflow as data_size is less or equal to
256256
// SLOT_SIZE and active_slot is valid for reads up to SLOT_SIZE.
257-
let read_end = unsafe { read_addr.unchecked_add(data_size) };
257+
let read_end = read_addr + data_size;
258258
while read_addr < read_end {
259259
let amount = (read_end - read_addr).min(buf.len());
260260

0 commit comments

Comments
 (0)