drop into_iter in some places

This commit is contained in:
Folkert 2023-10-07 15:30:25 +02:00
parent e6a154765c
commit 6ab54c02e2
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C
9 changed files with 21 additions and 21 deletions

View File

@ -205,7 +205,7 @@ impl<T> ArenaPool<T> {
// Add the arena's extra chunks to our own, so their memory remains live
// after the arena gets dropped. This is important, because at this
// point their pointers can still potentially be dereferenced!
self.extra_chunks.extend(arena.extra_chunks.into_iter());
self.extra_chunks.extend(arena.extra_chunks);
self.num_leased -= 1;
}

View File

@ -701,7 +701,7 @@ fn convert_tag(subs: &Subs, whole_var: Variable, this_tag: &TagName) -> (Union,
let mut my_tag_id = TagId(num_tags as TagIdIntType);
let mut alternatives = Vec::with_capacity(num_tags);
let alternatives_iter = sorted_tags.into_iter().chain(opt_openness_tag.into_iter());
let alternatives_iter = sorted_tags.into_iter().chain(opt_openness_tag);
let mut index = 0;
for (tag, args) in alternatives_iter {

View File

@ -1887,7 +1887,7 @@ fn build_tag<'a, 'ctx>(
);
let struct_type = env.context.struct_type(
env.arena.alloc_slice_fill_iter(field_types.into_iter()),
env.arena.alloc_slice_fill_iter(field_types),
false,
);

View File

@ -2237,7 +2237,7 @@ fn update<'a>(
// If we're building an app module, and this was the platform
// specified in its header's `to` field, record it as our platform.
if state.opt_platform_shorthand == Some(config_shorthand) {
debug_assert!(matches!(state.platform_data, None));
debug_assert!(state.platform_data.is_none());
state.platform_data = Some(PlatformData {
module_id: header.module_id,

View File

@ -70,7 +70,7 @@ impl MakeSpecializationsDependents {
"already added successors for module '{module_id:?}'"
);
entry.succ.extend(succ.into_iter());
entry.succ.extend(succ);
// The module for derives implicitly depends on every other module
entry.succ.insert(ModuleId::DERIVED_GEN);
@ -334,13 +334,13 @@ impl<'a> Dependencies<'a> {
let entry = self
.waiting_for
.entry(next_step.clone())
.or_insert_with(Default::default);
.or_default();
entry.insert(job.clone());
}
{
let entry = self.notifies.entry(job).or_insert_with(Default::default);
let entry = self.notifies.entry(job).or_default();
entry.insert(next_step);
}

View File

@ -198,7 +198,7 @@ impl<'a> PartialProcs<'a> {
pub fn drain(self) -> impl Iterator<Item = (Symbol, PartialProc<'a>)> {
debug_assert_eq!(self.symbols.len(), self.partial_procs.len());
self.symbols.into_iter().zip(self.partial_procs.into_iter())
self.symbols.into_iter().zip(self.partial_procs)
}
}
@ -541,7 +541,7 @@ impl<'a> ExternalSpecializations<'a> {
self.storage.into_storage_subs(),
self.symbol_or_lambda
.into_iter()
.zip(self.types_to_specialize.into_iter()),
.zip(self.types_to_specialize),
)
}
@ -656,8 +656,8 @@ impl<'a> Specialized<'a> {
fn into_iter_assert_done(self) -> impl Iterator<Item = (Symbol, ProcLayout<'a>, Proc<'a>)> {
self.symbols
.into_iter()
.zip(self.proc_layouts.into_iter())
.zip(self.procedures.into_iter())
.zip(self.proc_layouts)
.zip(self.procedures)
.filter_map(|((s, l), in_progress)| {
if let Symbol::REMOVED_SPECIALIZATION = s {
None

View File

@ -1937,7 +1937,7 @@ impl<'a> LambdaSet<'a> {
// it to both vectors.
let mut joined = set
.into_iter()
.zip(set_with_variables.into_iter())
.zip(set_with_variables)
.collect::<std::vec::Vec<_>>();
joined.sort_by(|(lam_and_captures1, _), (lam_and_captures2, _)| {
lam_and_captures1.cmp(lam_and_captures2)

View File

@ -2715,7 +2715,7 @@ impl VariableSubsSlice {
{
let start = subs.variables.len() as u32;
subs.variables.extend(input.into_iter());
subs.variables.extend(input);
let length = (subs.variables.len() as u32 - start) as u16;
@ -2939,7 +2939,7 @@ where
&self,
) -> impl Iterator<Item = (SubsIndex<L>, SubsIndex<VariableSubsSlice>)> + ExactSizeIterator
{
self.labels().into_iter().zip(self.variables().into_iter())
self.labels().into_iter().zip(self.variables())
}
/// Iterator over (Tag, &[Variable]) pairs obtained by
@ -3325,8 +3325,8 @@ impl RecordFields {
let it = range1
.into_iter()
.zip(range2.into_iter())
.zip(range3.into_iter());
.zip(range2)
.zip(range3);
it.map(|((i1, i2), i3)| (SubsIndex::new(i1), SubsIndex::new(i2), SubsIndex::new(i3)))
}
@ -3407,7 +3407,7 @@ impl TupleElems {
let range1 = helper(self.elem_index_start);
let range2 = helper(self.variables_start);
let it = range1.into_iter().zip(range2.into_iter());
let it = range1.into_iter().zip(range2);
it.map(|(i1, i2)| (SubsIndex::new(i1), SubsIndex::new(i2)))
}

View File

@ -731,15 +731,15 @@ fn unify_two_aliases<M: MetaCollector>(
let args_it = args
.type_variables()
.into_iter()
.zip(other_args.type_variables().into_iter());
.zip(other_args.type_variables());
let lambda_set_it = args
.lambda_set_variables()
.into_iter()
.zip(other_args.lambda_set_variables().into_iter());
.zip(other_args.lambda_set_variables());
let infer_ext_in_output_vars_it = (args.infer_ext_in_output_variables().into_iter())
.zip(other_args.infer_ext_in_output_variables().into_iter());
.zip(other_args.infer_ext_in_output_variables());
let mut merged_args = Vec::with_capacity(args.type_variables().len());
let mut merged_lambda_set_args = Vec::with_capacity(args.lambda_set_variables().len());
@ -3391,7 +3391,7 @@ fn unify_zip_slices<M: MetaCollector>(
) -> Outcome<M> {
let mut outcome = Outcome::default();
let it = left.into_iter().zip(right.into_iter());
let it = left.into_iter().zip(right);
for (l_index, r_index) in it {
let l_var = env[l_index];