Skip to content

Commit 59fc382

Browse files
committed
Fix clippy::unit_arg
1 parent 658d2f8 commit 59fc382

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

chalk-solve/src/clauses.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ fn match_ty<I: Interner>(
865865
ty: &Ty<I>,
866866
) -> Result<(), Floundered> {
867867
let interner = builder.interner();
868-
Ok(match ty.kind(interner) {
868+
match ty.kind(interner) {
869869
TyKind::InferenceVar(_, _) => {
870870
panic!("Inference vars not allowed when getting program clauses")
871871
}
@@ -1080,7 +1080,8 @@ fn match_ty<I: Interner>(
10801080
builder.push_clause(WellFormed::Ty(ty.clone()), wf_goals);
10811081
});
10821082
}
1083-
})
1083+
}
1084+
Ok(())
10841085
}
10851086

10861087
fn match_alias_ty<I: Interner>(

chalk-solve/src/infer/unify.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,11 @@ impl<'t, I: Interner> Unifier<'t, I> {
360360
fn unify_var_var(&mut self, a: InferenceVar, b: InferenceVar) -> Fallible<()> {
361361
let var1 = EnaVariable::from(a);
362362
let var2 = EnaVariable::from(b);
363-
Ok(self
364-
.table
363+
self.table
365364
.unify
366365
.unify_var_var(var1, var2)
367-
.expect("unification of two unbound variables cannot fail"))
366+
.expect("unification of two unbound variables cannot fail");
367+
Ok(())
368368
}
369369

370370
/// Unify a general inference variable with a specific inference variable
@@ -1001,7 +1001,8 @@ impl<'t, I: Interner> Unifier<'t, I> {
10011001
| (&LifetimeData::Erased, &LifetimeData::Placeholder(_))
10021002
| (&LifetimeData::Erased, &LifetimeData::Empty(_)) => {
10031003
if a != b {
1004-
Ok(self.push_lifetime_outlives_goals(variance, a.clone(), b.clone()))
1004+
self.push_lifetime_outlives_goals(variance, a.clone(), b.clone());
1005+
Ok(())
10051006
} else {
10061007
Ok(())
10071008
}
@@ -1041,11 +1042,12 @@ impl<'t, I: Interner> Unifier<'t, I> {
10411042
"{:?} in {:?} cannot see {:?}; pushing constraint",
10421043
var, var_ui, value_ui
10431044
);
1044-
Ok(self.push_lifetime_outlives_goals(
1045+
self.push_lifetime_outlives_goals(
10451046
variance,
10461047
var.to_lifetime(self.interner),
10471048
value.clone(),
1048-
))
1049+
);
1050+
Ok(())
10491051
}
10501052
}
10511053

@@ -1082,11 +1084,11 @@ impl<'t, I: Interner> Unifier<'t, I> {
10821084
debug!(?var1, ?var2, "relate_ty_ty");
10831085
let var1 = EnaVariable::from(var1);
10841086
let var2 = EnaVariable::from(var2);
1085-
Ok(self
1086-
.table
1087+
self.table
10871088
.unify
10881089
.unify_var_var(var1, var2)
1089-
.expect("unification of two unbound variables cannot fail"))
1090+
.expect("unification of two unbound variables cannot fail");
1091+
Ok(())
10901092
}
10911093

10921094
// Unifying an inference variables with a non-inference variable.

0 commit comments

Comments
 (0)