From 013ab6cdb116a4c194ef5ed5fdeda55e68d49fe7 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 26 May 2025 10:38:02 +0000 Subject: Use `builin_index` instead of hand-rolling it --- clippy_utils/src/consts.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'clippy_utils') diff --git a/clippy_utils/src/consts.rs b/clippy_utils/src/consts.rs index 6f5b0ec54cd..1ec5d11384f 100644 --- a/clippy_utils/src/consts.rs +++ b/clippy_utils/src/consts.rs @@ -235,9 +235,7 @@ impl Constant<'_> { _ => None, }, (Self::Vec(l), Self::Vec(r)) => { - let (ty::Array(cmp_type, _) | ty::Slice(cmp_type)) = *cmp_type.kind() else { - return None; - }; + let cmp_type = cmp_type.builtin_index()?; iter::zip(l, r) .map(|(li, ri)| Self::partial_cmp(tcx, cmp_type, li, ri)) .find(|r| r.is_none_or(|o| o != Ordering::Equal)) -- cgit 1.4.1-3-g733a5