From a2a4cababeafcc5d5de0b26ba6e0d630480220dc Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 3 Feb 2022 13:51:37 -0700 Subject: [PATCH] rustc_mir_dataflow: use iter::once instead of Some().into_iter --- compiler/rustc_mir_dataflow/src/elaborate_drops.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs index 501bc96401a..a3294672f54 100644 --- a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs +++ b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs @@ -8,7 +8,7 @@ use rustc_middle::ty::util::IntTypeExt; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_target::abi::VariantIdx; -use std::fmt; +use std::{fmt, iter}; /// The value of an inserted drop flag. #[derive(Debug, PartialEq, Eq, Copy, Clone)] @@ -329,8 +329,7 @@ fn drop_halfladder( mut succ: BasicBlock, fields: &[(Place<'tcx>, Option)], ) -> Vec { - Some(succ) - .into_iter() + iter::once(succ) .chain(fields.iter().rev().zip(unwind_ladder).map(|(&(place, path), &unwind_succ)| { succ = self.drop_subpath(place, path, succ, unwind_succ); succ