clippy fixes

This commit is contained in:
Kasey White 2023-02-26 00:06:24 -05:00 committed by Kasey
parent 665a8dec67
commit 2f2be39813
1 changed files with 26 additions and 24 deletions

View File

@ -276,34 +276,36 @@ impl<'a> CodeGenerator<'a> {
return; return;
} }
} }
ValueConstructorVariant::ModuleFn { builtin, .. } => { ValueConstructorVariant::ModuleFn {
if let Some(func) = builtin { builtin: Some(func),
ir_stack.push(Air::Builtin { ..
scope: scope.clone(), } => {
count: func.arity(), ir_stack.push(Air::Builtin {
func: func.clone(), scope: scope.clone(),
tipo: tipo.clone(), count: func.arity(),
}); func: *func,
tipo: tipo.clone(),
});
if let Some(fun_arg_types) = fun.tipo().arg_types() { if let Some(fun_arg_types) = fun.tipo().arg_types() {
for (arg, func_type) in args.iter().zip(fun_arg_types) { for (arg, func_type) in args.iter().zip(fun_arg_types) {
let mut scope = scope.clone(); let mut scope = scope.clone();
scope.push(self.id_gen.next()); scope.push(self.id_gen.next());
if func_type.is_data() && !arg.value.tipo().is_data() { if func_type.is_data() && !arg.value.tipo().is_data() {
ir_stack.push(Air::WrapData { ir_stack.push(Air::WrapData {
scope: scope.clone(), scope: scope.clone(),
tipo: arg.value.tipo(), tipo: arg.value.tipo(),
}) })
}
self.build_ir(&arg.value, ir_stack, scope);
} }
} else {
unreachable!() self.build_ir(&arg.value, ir_stack, scope);
} }
return; } else {
unreachable!()
} }
return;
} }
_ => {} _ => {}
}, },
@ -364,7 +366,7 @@ impl<'a> CodeGenerator<'a> {
ir_stack.push(Air::Builtin { ir_stack.push(Air::Builtin {
scope: scope.clone(), scope: scope.clone(),
count: func.arity(), count: func.arity(),
func: func.clone(), func: *func,
tipo: tipo.clone(), tipo: tipo.clone(),
}); });