From 01e91b9fe593317d28687eccbe53d4d90fe128d9 Mon Sep 17 00:00:00 2001 From: rvcas Date: Thu, 10 Nov 2022 01:24:40 -0500 Subject: [PATCH] chore: deal with clippy warnings --- crates/lang/src/tipo/environment.rs | 2 ++ crates/lang/src/uplc.rs | 2 +- crates/uplc/src/debruijn.rs | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/lang/src/tipo/environment.rs b/crates/lang/src/tipo/environment.rs index dc2c697e..a4828c67 100644 --- a/crates/lang/src/tipo/environment.rs +++ b/crates/lang/src/tipo/environment.rs @@ -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, t2: Arc, location: Span) -> Result<(), Error> { if t1 == t2 { return Ok(()); @@ -1536,6 +1537,7 @@ fn get_compatible_record_fields( /// 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, ctx_level: usize) -> Arc { match t.deref() { Type::Var { tipo } => match tipo.borrow().deref() { diff --git a/crates/lang/src/uplc.rs b/crates/lang/src/uplc.rs index df1524ae..f54d6820 100644 --- a/crates/lang/src/uplc.rs +++ b/crates/lang/src/uplc.rs @@ -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()) diff --git a/crates/uplc/src/debruijn.rs b/crates/uplc/src/debruijn.rs index 0c4cfcef..90b23346 100644 --- a/crates/uplc/src/debruijn.rs +++ b/crates/uplc/src/debruijn.rs @@ -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) -> Term { 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) -> Term { 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, @@ -287,6 +290,7 @@ impl Converter { } } + #[allow(clippy::only_used_in_recursion)] pub fn named_debruijn_to_fake_named_debruijn( &mut self, term: &Term,