Skip to content

Commit a23fcf3

Browse files
committed
std_detect: Tidying of slice length
We don't need to put the length of the `riscv_hwprobe` array into a variable. This commit removes that variable and gives the length of the output slice to the `__riscv_hwprobe` directly.
1 parent 5a7342f commit a23fcf3

File tree

1 file changed

+1
-2
lines changed
  • crates/std_detect/src/detect/os/linux

1 file changed

+1
-2
lines changed

crates/std_detect/src/detect/os/linux/riscv.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ fn _riscv_hwprobe(out: &mut [riscv_hwprobe]) -> bool {
124124
}
125125
}
126126

127-
let len = out.len();
128-
unsafe { __riscv_hwprobe(out.as_mut_ptr(), len, 0, ptr::null_mut(), 0) == 0 }
127+
unsafe { __riscv_hwprobe(out.as_mut_ptr(), out.len(), 0, ptr::null_mut(), 0) == 0 }
129128
}
130129

131130
/// Read list of supported features from (1) the auxiliary vector

0 commit comments

Comments
 (0)