]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/mir/terminator.rs
Rollup merge of #83571 - a1phyr:feature_const_slice_first_last, r=dtolnay
[rust.git] / compiler / rustc_middle / src / mir / terminator.rs
index 887dbefa9f2da411bddbd8e4940b79dec02f1237..c8db4aeb449b87e66b1a99e78572f7046a1dce98 100644 (file)
@@ -67,7 +67,7 @@ pub fn otherwise(&self) -> BasicBlock {
     ///
     /// Note that this may yield 0 elements. Only the `otherwise` branch is mandatory.
     pub fn iter(&self) -> SwitchTargetsIter<'_> {
-        SwitchTargetsIter { inner: self.values.iter().zip(self.targets.iter()) }
+        SwitchTargetsIter { inner: iter::zip(&self.values, &self.targets) }
     }
 
     /// Returns a slice with all possible jump targets (including the fallback target).