fix new clippy warnings

This commit is contained in:
Folkert 2020-10-10 19:59:58 +02:00
parent 7963843b9c
commit d346482b76
4 changed files with 17 additions and 21 deletions

View file

@ -2635,7 +2635,7 @@ fn to_opt_branches<'a>(
env.problems.push(MonoProblem::PatternProblem(error)) env.problems.push(MonoProblem::PatternProblem(error))
} }
overlapping_branches.sort(); overlapping_branches.sort_unstable();
for i in overlapping_branches.into_iter().rev() { for i in overlapping_branches.into_iter().rev() {
opt_branches.remove(i); opt_branches.remove(i);

View file

@ -470,7 +470,7 @@ fn solve(
let final_mark = visit_mark.next(); let final_mark = visit_mark.next();
debug_assert!({ debug_assert!({
let offenders = next_pools next_pools
.get(next_rank) .get(next_rank)
.iter() .iter()
.filter(|var| { .filter(|var| {
@ -481,9 +481,8 @@ fn solve(
.into_usize() .into_usize()
> next_rank.into_usize() > next_rank.into_usize()
}) })
.collect::<Vec<&roc_types::subs::Variable>>(); .count()
== 0
offenders.is_empty()
}); });
// pop pool // pop pool
@ -764,10 +763,10 @@ fn check_for_infinite_type(
) { ) {
let var = loc_var.value; let var = loc_var.value;
let is_uniq_infer = match subs.get(var).content { let is_uniq_infer = matches!(
Content::Alias(Symbol::ATTR_ATTR, _, _) => true, subs.get(var).content,
_ => false, Content::Alias(Symbol::ATTR_ATTR, _, _)
}; );
while let Some((recursive, chain)) = subs.occurs(var) { while let Some((recursive, chain)) = subs.occurs(var) {
let description = subs.get(recursive); let description = subs.get(recursive);

View file

@ -52,10 +52,10 @@ pub enum Bool {
} }
pub fn var_is_shared(subs: &Subs, var: Variable) -> bool { pub fn var_is_shared(subs: &Subs, var: Variable) -> bool {
match subs.get_without_compacting(var).content { matches!(
Content::Structure(FlatType::Boolean(Bool::Shared)) => true, subs.get_without_compacting(var).content,
_ => false, Content::Structure(FlatType::Boolean(Bool::Shared))
} )
} }
/// Given the Subs /// Given the Subs
@ -163,10 +163,7 @@ impl Bool {
} }
pub fn is_unique(&self, subs: &Subs) -> bool { pub fn is_unique(&self, subs: &Subs) -> bool {
match self.simplify(subs) { !matches!(self.simplify(subs), Shared)
Shared => false,
_ => true,
}
} }
pub fn variables(&self) -> SendSet<Variable> { pub fn variables(&self) -> SendSet<Variable> {

View file

@ -531,10 +531,10 @@ pub enum Content {
impl Content { impl Content {
#[inline(always)] #[inline(always)]
pub fn is_number(&self) -> bool { pub fn is_number(&self) -> bool {
match &self { matches!(
Content::Structure(FlatType::Apply(Symbol::NUM_NUM, _)) => true, &self,
_ => false, Content::Structure(FlatType::Apply(Symbol::NUM_NUM, _))
} )
} }
pub fn is_unique(&self, subs: &Subs) -> bool { pub fn is_unique(&self, subs: &Subs) -> bool {