about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/stable_mir/src/mir/body.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/stable_mir/src/mir/body.rs b/compiler/stable_mir/src/mir/body.rs
index 8ccc6732a8d..3a4f4283562 100644
--- a/compiler/stable_mir/src/mir/body.rs
+++ b/compiler/stable_mir/src/mir/body.rs
@@ -672,10 +672,7 @@ pub struct SwitchTargets {
 impl SwitchTargets {
     /// All possible targets including the `otherwise` target.
     pub fn all_targets(&self) -> Successors {
-        Some(self.otherwise)
-            .into_iter()
-            .chain(self.branches.iter().map(|(_, target)| *target))
-            .collect()
+        self.branches.iter().map(|(_, target)| *target).chain(Some(self.otherwise)).collect()
     }
 
     /// The `otherwise` branch target.