From 7480b501b4073cb38bacb64f22d7b09fb3f652d8 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 2 Jun 2022 11:31:23 +1000 Subject: [PATCH] Avoid some unnecessary `return`s. --- compiler/rustc_infer/src/infer/freshen.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/compiler/rustc_infer/src/infer/freshen.rs b/compiler/rustc_infer/src/infer/freshen.rs index 0a11a81c294..64c0c0f4f64 100644 --- a/compiler/rustc_infer/src/infer/freshen.rs +++ b/compiler/rustc_infer/src/infer/freshen.rs @@ -228,12 +228,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> { .probe_value(v) .val .known(); - return self.freshen_const( - opt_ct, - ty::InferConst::Var(v), - ty::InferConst::Fresh, - ct.ty(), - ); + self.freshen_const(opt_ct, ty::InferConst::Var(v), ty::InferConst::Fresh, ct.ty()) } ty::ConstKind::Infer(ty::InferConst::Fresh(i)) => { if i >= self.const_freshen_count { @@ -244,7 +239,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> { self.const_freshen_count, ); } - return ct; + ct } ty::ConstKind::Bound(..) | ty::ConstKind::Placeholder(_) => { @@ -254,9 +249,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> { ty::ConstKind::Param(_) | ty::ConstKind::Value(_) | ty::ConstKind::Unevaluated(..) - | ty::ConstKind::Error(_) => {} + | ty::ConstKind::Error(_) => ct.super_fold_with(self), } - - ct.super_fold_with(self) } }