about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-12-11 17:32:03 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-12-11 23:02:17 +0100
commit5c8de1cf4971e5800e2dd33393eef7ad7b8b78be (patch)
tree6fafbe7b8aee0a32ad31c5514cd89e82bcd6ee23 /compiler/rustc_codegen_llvm/src
parent2225ee1b62ff089917434aefd9b2bf509cfa087f (diff)
downloadrust-5c8de1cf4971e5800e2dd33393eef7ad7b8b78be.tar.gz
rust-5c8de1cf4971e5800e2dd33393eef7ad7b8b78be.zip
use strip_prefix over slicing (clippy::manual_strip)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/intrinsic.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs
index ec557b7a682..bf0d499e6c4 100644
--- a/compiler/rustc_codegen_llvm/src/intrinsic.rs
+++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs
@@ -854,8 +854,8 @@ fn generic_simd_intrinsic(
         ));
     }
 
-    if name_str.starts_with("simd_shuffle") {
-        let n: u64 = name_str["simd_shuffle".len()..].parse().unwrap_or_else(|_| {
+    if let Some(stripped) = name_str.strip_prefix("simd_shuffle") {
+        let n: u64 = stripped.parse().unwrap_or_else(|_| {
             span_bug!(span, "bad `simd_shuffle` instruction only caught in codegen?")
         });