diff --git a/compiler/constrain/src/expr.rs b/compiler/constrain/src/expr.rs index 4cc62269f5..86c01a56c2 100644 --- a/compiler/constrain/src/expr.rs +++ b/compiler/constrain/src/expr.rs @@ -722,7 +722,7 @@ pub fn constrain_expr( pattern_cons.push(expr_con); // Now check the condition against the type expected by the branches. - let sketched_rows = sketch_rows(real_cond_var, branches_region, &branches); + let sketched_rows = sketch_rows(real_cond_var, branches_region, branches); let cond_matches_branches_constraint = constraints.exhaustive( real_cond_var, loc_cond.region, diff --git a/compiler/mono/src/ir.rs b/compiler/mono/src/ir.rs index 4f4b2accfe..1a78f24f3c 100644 --- a/compiler/mono/src/ir.rs +++ b/compiler/mono/src/ir.rs @@ -5847,7 +5847,7 @@ fn to_opt_branches<'a>( Ok((mono_pattern, assignments)) => { loc_branches.push(( Loc::at(loc_pattern.region, mono_pattern.clone()), - exhaustive_guard.clone(), + exhaustive_guard, )); let mut loc_expr = when_branch.value.clone(); @@ -5877,7 +5877,7 @@ fn to_opt_branches<'a>( Err(runtime_error) => { loc_branches.push(( Loc::at(loc_pattern.region, Pattern::Underscore), - exhaustive_guard.clone(), + exhaustive_guard, )); // TODO remove clone? diff --git a/compiler/solve/src/solve.rs b/compiler/solve/src/solve.rs index 6784a10082..7b9d8d65ef 100644 --- a/compiler/solve/src/solve.rs +++ b/compiler/solve/src/solve.rs @@ -1222,11 +1222,16 @@ fn solve( let real_content = subs.get_content_without_compacting(real_var); let branches_content = subs.get_content_without_compacting(branches_var); - let already_have_error = match (real_content, branches_content) { - (Content::Error | Content::Structure(FlatType::Erroneous(_)), _) => true, - (_, Content::Error | Content::Structure(FlatType::Erroneous(_))) => true, - _ => false, - }; + let already_have_error = matches!( + (real_content, branches_content), + ( + Content::Error | Content::Structure(FlatType::Erroneous(_)), + _ + ) | ( + _, + Content::Error | Content::Structure(FlatType::Erroneous(_)) + ) + ); let snapshot = subs.snapshot(); let outcome = unify(subs, real_var, branches_var, Mode::EQ); @@ -1303,7 +1308,7 @@ fn solve( let sketched_rows = constraints.sketched_rows[sketched_rows.index()].clone(); if should_check_exhaustiveness { - let checked = roc_can::exhaustive::check(&subs, sketched_rows, context); + let checked = roc_can::exhaustive::check(subs, sketched_rows, context); if let Err(errors) = checked { problems.extend(errors.into_iter().map(TypeError::Exhaustive)); }