Skip to content

Commit 02b6715

Browse files
committed
Fix lint
1 parent 46657d3 commit 02b6715

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,9 +2405,7 @@ fn typetree_from_ty_impl_inner<'tcx>(
24052405
}
24062406

24072407
if ty.is_ref() || ty.is_raw_ptr() || ty.is_box() {
2408-
let inner_ty = if let Some(inner) = ty.builtin_deref(true) {
2409-
inner
2410-
} else {
2408+
let Some(inner_ty) = ty.builtin_deref(true) else {
24112409
return TypeTree::new();
24122410
};
24132411

compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -445,17 +445,15 @@ where
445445
goal_kind: ty::ClosureKind,
446446
) -> Result<Candidate<I>, NoSolution> {
447447
let cx = ecx.cx();
448-
let tupled_inputs_and_output =
449-
match structural_traits::extract_tupled_inputs_and_output_from_callable(
448+
let Some(tupled_inputs_and_output) =
449+
structural_traits::extract_tupled_inputs_and_output_from_callable(
450450
cx,
451451
goal.predicate.self_ty(),
452452
goal_kind,
453-
)? {
454-
Some(tupled_inputs_and_output) => tupled_inputs_and_output,
455-
None => {
456-
return ecx.forced_ambiguity(MaybeCause::Ambiguity);
457-
}
458-
};
453+
)?
454+
else {
455+
return ecx.forced_ambiguity(MaybeCause::Ambiguity);
456+
};
459457
let (inputs, output) = ecx.instantiate_binder_with_infer(tupled_inputs_and_output);
460458

461459
// A built-in `Fn` impl only holds if the output is sized.

compiler/rustc_next_trait_solver/src/solve/trait_goals.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,17 +360,15 @@ where
360360
}
361361

362362
let cx = ecx.cx();
363-
let tupled_inputs_and_output =
364-
match structural_traits::extract_tupled_inputs_and_output_from_callable(
363+
let Some(tupled_inputs_and_output) =
364+
structural_traits::extract_tupled_inputs_and_output_from_callable(
365365
cx,
366366
goal.predicate.self_ty(),
367367
goal_kind,
368-
)? {
369-
Some(a) => a,
370-
None => {
371-
return ecx.forced_ambiguity(MaybeCause::Ambiguity);
372-
}
373-
};
368+
)?
369+
else {
370+
return ecx.forced_ambiguity(MaybeCause::Ambiguity);
371+
};
374372
let (inputs, output) = ecx.instantiate_binder_with_infer(tupled_inputs_and_output);
375373

376374
// A built-in `Fn` impl only holds if the output is sized.

0 commit comments

Comments
 (0)