mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
remove unneeded use of impl Borrow
This commit is contained in:
parent
84970f3c74
commit
a5b3f9fb50
1 changed files with 7 additions and 8 deletions
|
@ -1685,7 +1685,6 @@ impl LocalDefVarsVec<(Symbol, Loc<Variable>)> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
use std::borrow::Borrow;
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::ops::ControlFlow;
|
use std::ops::ControlFlow;
|
||||||
std::thread_local! {
|
std::thread_local! {
|
||||||
|
@ -2391,12 +2390,12 @@ fn insert_tags_fast_path<'a>(
|
||||||
rank: Rank,
|
rank: Rank,
|
||||||
pools: &mut Pools,
|
pools: &mut Pools,
|
||||||
arena: &'_ bumpalo::Bump,
|
arena: &'_ bumpalo::Bump,
|
||||||
tags: &'a [(TagName, impl Borrow<[Type]>)],
|
tags: &'a [(TagName, Vec<Type>)],
|
||||||
stack: &mut bumpalo::collections::Vec<'_, TypeToVar<'a>>,
|
stack: &mut bumpalo::collections::Vec<'_, TypeToVar<'a>>,
|
||||||
) -> UnionTags {
|
) -> UnionTags {
|
||||||
if let [(TagName(tag_name), arguments)] = tags {
|
if let [(TagName(tag_name), arguments)] = tags {
|
||||||
let variable_slice =
|
let variable_slice =
|
||||||
register_tag_arguments(subs, rank, pools, arena, stack, arguments.borrow());
|
register_tag_arguments(subs, rank, pools, arena, stack, arguments.as_slice());
|
||||||
let new_variable_slices =
|
let new_variable_slices =
|
||||||
SubsSlice::extend_new(&mut subs.variable_slices, [variable_slice]);
|
SubsSlice::extend_new(&mut subs.variable_slices, [variable_slice]);
|
||||||
|
|
||||||
|
@ -2423,7 +2422,7 @@ fn insert_tags_fast_path<'a>(
|
||||||
|
|
||||||
for (variable_slice_index, (_, arguments)) in it {
|
for (variable_slice_index, (_, arguments)) in it {
|
||||||
subs.variable_slices[variable_slice_index] =
|
subs.variable_slices[variable_slice_index] =
|
||||||
register_tag_arguments(subs, rank, pools, arena, stack, arguments.borrow());
|
register_tag_arguments(subs, rank, pools, arena, stack, arguments.as_slice());
|
||||||
}
|
}
|
||||||
|
|
||||||
UnionTags::from_slices(new_tag_names, new_variable_slices)
|
UnionTags::from_slices(new_tag_names, new_variable_slices)
|
||||||
|
@ -2437,7 +2436,7 @@ fn insert_tags_fast_path<'a>(
|
||||||
|
|
||||||
for ((variable_slice_index, tag_name_index), (tag_name, arguments)) in it {
|
for ((variable_slice_index, tag_name_index), (tag_name, arguments)) in it {
|
||||||
subs.variable_slices[variable_slice_index] =
|
subs.variable_slices[variable_slice_index] =
|
||||||
register_tag_arguments(subs, rank, pools, arena, stack, arguments.borrow());
|
register_tag_arguments(subs, rank, pools, arena, stack, arguments.as_slice());
|
||||||
|
|
||||||
subs.tag_names[tag_name_index] = tag_name.clone();
|
subs.tag_names[tag_name_index] = tag_name.clone();
|
||||||
}
|
}
|
||||||
|
@ -2452,12 +2451,12 @@ fn insert_tags_slow_path<'a>(
|
||||||
rank: Rank,
|
rank: Rank,
|
||||||
pools: &mut Pools,
|
pools: &mut Pools,
|
||||||
arena: &'_ bumpalo::Bump,
|
arena: &'_ bumpalo::Bump,
|
||||||
tags: &'a [(TagName, impl Borrow<[Type]>)],
|
tags: &'a [(TagName, Vec<Type>)],
|
||||||
mut tag_vars: bumpalo::collections::Vec<(TagName, VariableSubsSlice)>,
|
mut tag_vars: bumpalo::collections::Vec<(TagName, VariableSubsSlice)>,
|
||||||
stack: &mut bumpalo::collections::Vec<'_, TypeToVar<'a>>,
|
stack: &mut bumpalo::collections::Vec<'_, TypeToVar<'a>>,
|
||||||
) -> UnionTags {
|
) -> UnionTags {
|
||||||
for (tag, tag_argument_types) in tags {
|
for (tag, tag_argument_types) in tags {
|
||||||
let tag_argument_types: &[Type] = tag_argument_types.borrow();
|
let tag_argument_types: &[Type] = tag_argument_types.as_slice();
|
||||||
let new_slice = VariableSubsSlice::reserve_into_subs(subs, tag_argument_types.len());
|
let new_slice = VariableSubsSlice::reserve_into_subs(subs, tag_argument_types.len());
|
||||||
|
|
||||||
for (i, arg) in (new_slice.indices()).zip(tag_argument_types) {
|
for (i, arg) in (new_slice.indices()).zip(tag_argument_types) {
|
||||||
|
@ -2478,7 +2477,7 @@ fn type_to_union_tags<'a>(
|
||||||
rank: Rank,
|
rank: Rank,
|
||||||
pools: &mut Pools,
|
pools: &mut Pools,
|
||||||
arena: &'_ bumpalo::Bump,
|
arena: &'_ bumpalo::Bump,
|
||||||
tags: &'a [(TagName, impl Borrow<[Type]>)],
|
tags: &'a [(TagName, Vec<Type>)],
|
||||||
ext: &'a TypeExtension,
|
ext: &'a TypeExtension,
|
||||||
stack: &mut bumpalo::collections::Vec<'_, TypeToVar<'a>>,
|
stack: &mut bumpalo::collections::Vec<'_, TypeToVar<'a>>,
|
||||||
) -> (UnionTags, Variable) {
|
) -> (UnionTags, Variable) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue