about summary refs log tree commit diff
path: root/library/stdarch/crates/std_detect/src/detect
diff options
context:
space:
mode:
authorTsukasa OI <floss_rust@irq.a4lg.com>2025-06-29 07:06:25 +0000
committerAmanieu d'Antras <amanieu@gmail.com>2025-07-03 11:26:07 +0000
commite101e383d0580e642548a5e935a9ff844339159a (patch)
treefb58443f10c2daf8163b1a6b70bd77644f92a072 /library/stdarch/crates/std_detect/src/detect
parent36462f901e5b45eec36ea52000c8f2caa4b8ea67 (diff)
downloadrust-e101e383d0580e642548a5e935a9ff844339159a.tar.gz
rust-e101e383d0580e642548a5e935a9ff844339159a.zip
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.
Diffstat (limited to 'library/stdarch/crates/std_detect/src/detect')
-rw-r--r--library/stdarch/crates/std_detect/src/detect/os/linux/riscv.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/riscv.rs b/library/stdarch/crates/std_detect/src/detect/os/linux/riscv.rs
index 5506ff31fc7..e044d5f1541 100644
--- a/library/stdarch/crates/std_detect/src/detect/os/linux/riscv.rs
+++ b/library/stdarch/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