Do what clippy suggests

This commit is contained in:
Richard Feldman 2019-12-18 18:29:11 -05:00
parent e37f10de3f
commit 9745459522
2 changed files with 5 additions and 5 deletions

View file

@ -160,7 +160,7 @@ fn type_to_variable(subs: &mut Subs, aliases: &ImMap<Lowercase, Variable>, typ:
let arg_var = type_to_variable(subs, aliases, arg_type.clone()); let arg_var = type_to_variable(subs, aliases, arg_type.clone());
arg_vars.push((arg.clone(), arg_var)); arg_vars.push((arg.clone(), arg_var));
new_aliases.insert(arg.into(), arg_var); new_aliases.insert(arg, arg_var);
} }
let alias_var = type_to_variable(subs, &new_aliases, *alias_type); let alias_var = type_to_variable(subs, &new_aliases, *alias_type);
@ -185,7 +185,7 @@ fn check_for_infinite_type(
let var = loc_var.value; let var = loc_var.value;
if subs.occurs(var) { if subs.occurs(var) {
let error_type = subs.to_error_type(var); let error_type = subs.var_to_error_type(var);
let problem = Problem::CircularType(symbol, error_type, loc_var.region); let problem = Problem::CircularType(symbol, error_type, loc_var.region);
subs.set_content(var, Content::Error(problem.clone())); subs.set_content(var, Content::Error(problem.clone()));

View file

@ -212,7 +212,7 @@ impl Subs {
occurs(self, &ImSet::default(), var) occurs(self, &ImSet::default(), var)
} }
pub fn to_error_type(&mut self, var: Variable) -> ErrorType { pub fn var_to_error_type(&mut self, var: Variable) -> ErrorType {
let names = get_var_names(self, var, ImMap::default()); let names = get_var_names(self, var, ImMap::default());
let mut taken = MutSet::default(); let mut taken = MutSet::default();
@ -248,7 +248,7 @@ impl Rank {
Rank(1) Rank(1)
} }
pub fn next(&self) -> Self { pub fn next(self) -> Self {
Rank(self.0 + 1) Rank(self.0 + 1)
} }
} }
@ -546,7 +546,7 @@ fn flat_type_to_err_type(subs: &mut Subs, state: &mut NameState, flat_type: Flat
.map(|var| var_to_err_type(subs, state, var)) .map(|var| var_to_err_type(subs, state, var))
.collect(); .collect();
ErrorType::Type(module_name.into(), name.into(), arg_types) ErrorType::Type(module_name, name, arg_types)
} }
Func(arg_vars, ret_var) => { Func(arg_vars, ret_var) => {