use strip_prefix over slicing (clippy::manual_strip)

This commit is contained in:
Matthias Krüger 2020-12-11 17:32:03 +01:00
parent 2225ee1b62
commit 5c8de1cf49
4 changed files with 23 additions and 23 deletions

View file

@ -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?")
});