From 3c17d86fa1237756666d080442a0793b1df93852 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Sun, 29 Jun 2025 07:06:25 +0000 Subject: [PATCH] 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. --- crates/std_detect/src/detect/os/linux/riscv.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/std_detect/src/detect/os/linux/riscv.rs b/crates/std_detect/src/detect/os/linux/riscv.rs index 5506ff31fc..e044d5f154 100644 --- a/crates/std_detect/src/detect/os/linux/riscv.rs +++ b/crates/std_detect/src/detect/os/linux/riscv.rs @@ -124,8 +124,7 @@ fn _riscv_hwprobe(out: &mut [riscv_hwprobe]) -> bool { } } - let len = out.len(); - unsafe { __riscv_hwprobe(out.as_mut_ptr(), len, 0, ptr::null_mut(), 0) == 0 } + unsafe { __riscv_hwprobe(out.as_mut_ptr(), out.len(), 0, ptr::null_mut(), 0) == 0 } } /// Read list of supported features from (1) the auxiliary vector