chore: deal with clippy warnings
This commit is contained in:
parent
4e05a28e59
commit
01e91b9fe5
|
@ -1093,6 +1093,7 @@ impl<'a> Environment<'a> {
|
|||
/// Any unbound type variables will be linked to the other type as they are the same.
|
||||
///
|
||||
/// It two types are found to not be the same an error is returned.
|
||||
#[allow(clippy::only_used_in_recursion)]
|
||||
pub fn unify(&mut self, t1: Arc<Type>, t2: Arc<Type>, location: Span) -> Result<(), Error> {
|
||||
if t1 == t2 {
|
||||
return Ok(());
|
||||
|
@ -1536,6 +1537,7 @@ fn get_compatible_record_fields<A>(
|
|||
|
||||
/// Takes a level and a type and turns all type variables within the type that have
|
||||
/// level higher than the input level into generalized (polymorphic) type variables.
|
||||
#[allow(clippy::only_used_in_recursion)]
|
||||
pub(crate) fn generalise(t: Arc<Type>, ctx_level: usize) -> Arc<Type> {
|
||||
match t.deref() {
|
||||
Type::Var { tipo } => match tipo.borrow().deref() {
|
||||
|
|
|
@ -649,7 +649,7 @@ impl<'a> CodeGenerator<'a> {
|
|||
let index =
|
||||
dt.constructors.iter().position(|c| name.clone() == c.name);
|
||||
data_type = dt.name.clone();
|
||||
current_module = module.clone().unwrap_or_else(|| "".to_string());
|
||||
current_module = module.clone().unwrap_or_default();
|
||||
total_constr_length = dt.constructors.len();
|
||||
|
||||
index.unwrap_or(dt.constructors.len())
|
||||
|
|
|
@ -214,6 +214,7 @@ impl Converter {
|
|||
Ok(converted_term)
|
||||
}
|
||||
|
||||
#[allow(clippy::only_used_in_recursion)]
|
||||
pub fn named_debruijn_to_debruijn(&mut self, term: &Term<NamedDeBruijn>) -> Term<DeBruijn> {
|
||||
match term {
|
||||
Term::Var(name) => Term::Var(name.clone().into()),
|
||||
|
@ -236,6 +237,7 @@ impl Converter {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::only_used_in_recursion)]
|
||||
pub fn debruijn_to_named_debruijn(&mut self, term: &Term<DeBruijn>) -> Term<NamedDeBruijn> {
|
||||
match term {
|
||||
Term::Var(name) => Term::Var((*name).into()),
|
||||
|
@ -258,6 +260,7 @@ impl Converter {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::only_used_in_recursion)]
|
||||
pub fn fake_named_debruijn_to_named_debruijn(
|
||||
&mut self,
|
||||
term: &Term<FakeNamedDeBruijn>,
|
||||
|
@ -287,6 +290,7 @@ impl Converter {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::only_used_in_recursion)]
|
||||
pub fn named_debruijn_to_fake_named_debruijn(
|
||||
&mut self,
|
||||
term: &Term<NamedDeBruijn>,
|
||||
|
|
Loading…
Reference in New Issue