about summary refs log tree commit diff
path: root/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs
diff options
context:
space:
mode:
authorTsukasa OI <floss_rust@irq.a4lg.com>2025-05-31 05:06:05 +0000
committerAmanieu d'Antras <amanieu@gmail.com>2025-05-31 09:38:49 +0000
commit26ff29e7e22b5022ec7e836381ba4e1dc0b1cb79 (patch)
tree495b6e3ca3e20193808e4e0536f297d633bb1ff1 /library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs
parentc5693ed5e434e0ff24a708f99bcc3c3671a51a30 (diff)
downloadrust-26ff29e7e22b5022ec7e836381ba4e1dc0b1cb79.tar.gz
rust-26ff29e7e22b5022ec7e836381ba4e1dc0b1cb79.zip
intrinsic-test: Modernization of the coding style
It modernizes the coding style of the crate intrinsic-test by fixing
Clippy warnings.

Clippy: rust version 1.89.0-nightly (6f6971078 2025-05-28)
Number of Fixed Warnings: 36/36
Diffstat (limited to 'library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs')
-rw-r--r--library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs b/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs
index d96e0429fc4..3d200b19461 100644
--- a/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs
+++ b/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs
@@ -117,11 +117,11 @@ impl IntrinsicType {
     }
 
     pub fn num_lanes(&self) -> u32 {
-        if let Some(sl) = self.simd_len { sl } else { 1 }
+        self.simd_len.unwrap_or(1)
     }
 
     pub fn num_vectors(&self) -> u32 {
-        if let Some(vl) = self.vec_len { vl } else { 1 }
+        self.vec_len.unwrap_or(1)
     }
 
     pub fn is_simd(&self) -> bool {
@@ -266,7 +266,7 @@ impl IntrinsicType {
 
     pub fn as_call_param_c(&self, name: &String) -> String {
         if self.ptr {
-            format!("&{}", name)
+            format!("&{name}")
         } else {
             name.clone()
         }
@@ -282,7 +282,7 @@ pub trait IntrinsicTypeDefinition: Deref<Target = IntrinsicType> {
     fn get_lane_function(&self) -> String;
 
     /// can be implemented in an `impl` block
-    fn from_c(_s: &str, _target: &String) -> Result<Box<Self>, String>;
+    fn from_c(_s: &str, _target: &str) -> Result<Box<Self>, String>;
 
     /// Gets a string containing the typename for this type in C format.
     /// can be directly defined in `impl` blocks