Skip to content

Commit 7480b50

Browse files
committed
Avoid some unnecessary returns.
1 parent 23880a0 commit 7480b50

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

compiler/rustc_infer/src/infer/freshen.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
228228
.probe_value(v)
229229
.val
230230
.known();
231-
return self.freshen_const(
232-
opt_ct,
233-
ty::InferConst::Var(v),
234-
ty::InferConst::Fresh,
235-
ct.ty(),
236-
);
231+
self.freshen_const(opt_ct, ty::InferConst::Var(v), ty::InferConst::Fresh, ct.ty())
237232
}
238233
ty::ConstKind::Infer(ty::InferConst::Fresh(i)) => {
239234
if i >= self.const_freshen_count {
@@ -244,7 +239,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
244239
self.const_freshen_count,
245240
);
246241
}
247-
return ct;
242+
ct
248243
}
249244

250245
ty::ConstKind::Bound(..) | ty::ConstKind::Placeholder(_) => {
@@ -254,9 +249,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
254249
ty::ConstKind::Param(_)
255250
| ty::ConstKind::Value(_)
256251
| ty::ConstKind::Unevaluated(..)
257-
| ty::ConstKind::Error(_) => {}
252+
| ty::ConstKind::Error(_) => ct.super_fold_with(self),
258253
}
259-
260-
ct.super_fold_with(self)
261254
}
262255
}

0 commit comments

Comments
 (0)