mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-24 20:42:29 +00:00
clippy --fix fixes
This commit is contained in:
parent
9973d4b8d2
commit
4cd8f0a056
57 changed files with 366 additions and 374 deletions
|
@ -1134,7 +1134,7 @@ fn canonicalize_has_clause(
|
|||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn can_extension_type<'a>(
|
||||
fn can_extension_type(
|
||||
env: &mut Env,
|
||||
pol: CanPolarity,
|
||||
scope: &mut Scope,
|
||||
|
@ -1142,7 +1142,7 @@ fn can_extension_type<'a>(
|
|||
introduced_variables: &mut IntroducedVariables,
|
||||
local_aliases: &mut VecMap<Symbol, Alias>,
|
||||
references: &mut VecSet<Symbol>,
|
||||
opt_ext: &Option<&Loc<TypeAnnotation<'a>>>,
|
||||
opt_ext: &Option<&Loc<TypeAnnotation<'_>>>,
|
||||
ext_problem_kind: roc_problem::can::ExtensionTypeKind,
|
||||
) -> (Type, ExtImplicitOpenness) {
|
||||
fn valid_record_ext_type(typ: &Type) -> bool {
|
||||
|
@ -1451,10 +1451,10 @@ fn can_assigned_fields<'a>(
|
|||
|
||||
// TODO trim down these arguments!
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn can_assigned_tuple_elems<'a>(
|
||||
fn can_assigned_tuple_elems(
|
||||
env: &mut Env,
|
||||
pol: CanPolarity,
|
||||
elems: &&[Loc<TypeAnnotation<'a>>],
|
||||
elems: &&[Loc<TypeAnnotation<'_>>],
|
||||
scope: &mut Scope,
|
||||
var_store: &mut VarStore,
|
||||
introduced_variables: &mut IntroducedVariables,
|
||||
|
|
|
@ -1051,7 +1051,6 @@ fn canonicalize_value_defs<'a>(
|
|||
|
||||
for (def_index, pending_def) in pending_value_defs.iter().enumerate() {
|
||||
let mut new_bindings = BindingsFromPattern::new(pending_def.loc_pattern())
|
||||
.into_iter()
|
||||
.peekable();
|
||||
|
||||
if new_bindings.peek().is_none() {
|
||||
|
@ -1339,8 +1338,8 @@ fn canonicalize_type_defs<'a>(
|
|||
|
||||
/// Resolve all pending abilities, to add them to scope.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn resolve_abilities<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn resolve_abilities(
|
||||
env: &mut Env<'_>,
|
||||
output: &mut Output,
|
||||
var_store: &mut VarStore,
|
||||
scope: &mut Scope,
|
||||
|
@ -2813,8 +2812,8 @@ fn to_pending_value_def<'a>(
|
|||
}
|
||||
|
||||
/// Make aliases recursive
|
||||
fn correct_mutual_recursive_type_alias<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn correct_mutual_recursive_type_alias(
|
||||
env: &mut Env<'_>,
|
||||
original_aliases: VecMap<Symbol, Alias>,
|
||||
var_store: &mut VarStore,
|
||||
) -> VecMap<Symbol, Alias> {
|
||||
|
@ -3022,8 +3021,8 @@ fn correct_mutual_recursive_type_alias<'a>(
|
|||
unsafe { VecMap::zip(symbols_introduced, aliases) }
|
||||
}
|
||||
|
||||
fn make_tag_union_of_alias_recursive<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn make_tag_union_of_alias_recursive(
|
||||
env: &mut Env<'_>,
|
||||
alias_name: Symbol,
|
||||
alias: &mut Alias,
|
||||
others: Vec<Symbol>,
|
||||
|
@ -3215,8 +3214,8 @@ fn make_tag_union_recursive_help<'a, 'b>(
|
|||
}
|
||||
}
|
||||
|
||||
fn mark_cyclic_alias<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn mark_cyclic_alias(
|
||||
env: &mut Env<'_>,
|
||||
typ: &mut Type,
|
||||
symbol: Symbol,
|
||||
alias_kind: AliasKind,
|
||||
|
|
|
@ -195,11 +195,11 @@ enum GeneratedInfo {
|
|||
}
|
||||
|
||||
impl GeneratedInfo {
|
||||
fn from_header_type<'a>(
|
||||
fn from_header_type(
|
||||
env: &mut Env,
|
||||
scope: &mut Scope,
|
||||
var_store: &mut VarStore,
|
||||
header_type: &HeaderType<'a>,
|
||||
header_type: &HeaderType<'_>,
|
||||
) -> Self {
|
||||
match header_type {
|
||||
HeaderType::Hosted {
|
||||
|
|
|
@ -321,8 +321,8 @@ pub fn canonicalize_def_header_pattern<'a>(
|
|||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub struct PermitShadows(pub bool);
|
||||
|
||||
fn canonicalize_pattern_symbol<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn canonicalize_pattern_symbol(
|
||||
env: &mut Env<'_>,
|
||||
scope: &mut Scope,
|
||||
output: &mut Output,
|
||||
region: Region,
|
||||
|
|
|
@ -122,7 +122,7 @@ pub fn walk_decls<V: Visitor>(visitor: &mut V, decls: &Declarations) {
|
|||
None => Pattern::Identifier(loc_symbol.value),
|
||||
};
|
||||
|
||||
let function_def = &decls.function_bodies[function_index.index() as usize];
|
||||
let function_def = &decls.function_bodies[function_index.index()];
|
||||
|
||||
DeclarationInfo::Function {
|
||||
loc_symbol,
|
||||
|
@ -133,7 +133,7 @@ pub fn walk_decls<V: Visitor>(visitor: &mut V, decls: &Declarations) {
|
|||
}
|
||||
}
|
||||
Destructure(destructure_index) => {
|
||||
let destructure = &decls.destructs[destructure_index.index() as usize];
|
||||
let destructure = &decls.destructs[destructure_index.index()];
|
||||
let loc_pattern = &destructure.loc_pattern;
|
||||
|
||||
let loc_expr = &decls.expressions[index];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue