Skip to content

Commit 1cce911

Browse files
committed
Fix clippy::needless_return
1 parent df5a36e commit 1cce911

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

chalk-engine/src/logic.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ impl<'forest, I: Interner> SolveState<'forest, I> {
687687
ex_clause.answer_time.increment();
688688

689689
// Ok, we've applied the answer to this Strand.
690-
return Ok(());
690+
Ok(())
691691
}
692692

693693
// This answer led nowhere. Give up for now, but of course
@@ -700,7 +700,7 @@ impl<'forest, I: Interner> SolveState<'forest, I> {
700700

701701
// Now we want to propogate back to the up with `QuantumExceeded`
702702
self.unwind_stack();
703-
return Err(RootSearchFail::QuantumExceeded);
703+
Err(RootSearchFail::QuantumExceeded)
704704
}
705705
}
706706
}
@@ -749,9 +749,9 @@ impl<'forest, I: Interner> SolveState<'forest, I> {
749749
strand.ex_clause.ambiguous = true;
750750

751751
// Strand is ambigious.
752-
return Ok(());
752+
Ok(())
753753
}
754-
};
754+
}
755755
}
756756

757757
/// This is called when the selected subgoal for a strand has floundered.
@@ -1224,7 +1224,7 @@ impl<'forest, I: Interner> SolveState<'forest, I> {
12241224

12251225
// Now we yield with `QuantumExceeded`
12261226
self.unwind_stack();
1227-
return Err(RootSearchFail::QuantumExceeded);
1227+
Err(RootSearchFail::QuantumExceeded)
12281228
} else {
12291229
debug!("table part of a cycle");
12301230

@@ -1267,7 +1267,7 @@ impl<'forest, I: Interner> SolveState<'forest, I> {
12671267
self.forest.tables[table].enqueue_strand(active_strand);
12681268

12691269
// The strand isn't active, but the table is, so just continue
1270-
return Ok(());
1270+
Ok(())
12711271
}
12721272
}
12731273

chalk-solve/src/infer/unify.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,7 @@ impl<'t, I: Interner> Unifier<'t, I> {
760760
) -> Lifetime<I> {
761761
let interner = self.interner;
762762
match lifetime.data(interner) {
763-
LifetimeData::BoundVar(_) => {
764-
return lifetime.clone();
765-
}
763+
LifetimeData::BoundVar(_) => lifetime.clone(),
766764
_ => {
767765
if matches!(variance, Variance::Invariant) {
768766
lifetime.clone()
@@ -779,9 +777,7 @@ impl<'t, I: Interner> Unifier<'t, I> {
779777
let interner = self.interner;
780778
let data = const_.data(interner);
781779
match data.value {
782-
ConstValue::BoundVar(_) => {
783-
return const_.clone();
784-
}
780+
ConstValue::BoundVar(_) => const_.clone(),
785781
_ => {
786782
let ena_var = self.table.new_variable(universe_index);
787783
ena_var.to_const(interner, data.ty.clone())

0 commit comments

Comments
 (0)