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))
}
overlapping_branches.sort();
overlapping_branches.sort_unstable();
for i in overlapping_branches.into_iter().rev() {
opt_branches.remove(i);

View file

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

View file

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

View file

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