Skip to content

Commit 28347eb

Browse files
committed
Drop an unnecessary intermediate variable
Neither does it shorten the code nor does it provide a helpful name.
1 parent e9920ef commit 28347eb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/rustc_typeck/src/check/upvar.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
260260
// local crate or were inlined into it along with some function.
261261
// This may change if abstract return types of some sort are
262262
// implemented.
263-
let tcx = self.tcx;
264-
265263
self.typeck_results
266264
.borrow()
267265
.closure_min_captures_flattened(closure_id)
@@ -276,7 +274,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
276274

277275
match capture {
278276
ty::UpvarCapture::ByValue(_) => upvar_ty,
279-
ty::UpvarCapture::ByRef(borrow) => tcx.mk_ref(
277+
ty::UpvarCapture::ByRef(borrow) => self.tcx.mk_ref(
280278
borrow.region,
281279
ty::TypeAndMut { ty: upvar_ty, mutbl: borrow.kind.to_mutbl_lossy() },
282280
),

0 commit comments

Comments
 (0)