Skip to content

Commit 2e3b64d

Browse files
committed
Auto merge of rust-lang#89861 - nbdd0121:closure, r=wesleywiser
Closure capture cleanup & refactor Follow up of rust-lang#89648 Each commit is self-contained and the rationale/changes are documented in the commit message, so it's advisable to review commit by commit. The code is significantly cleaner (at least IMO), but that could have some perf implication, so I'd suggest a perf run. r? `@wesleywiser` cc `@arora-aman`
2 parents dda2aef + 7e2ccb0 commit 2e3b64d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_utils/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,8 @@ pub fn can_move_expr_to_closure(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) ->
976976
};
977977
if !self.locals.contains(&local_id) {
978978
let capture = match capture.info.capture_kind {
979-
UpvarCapture::ByValue(_) => CaptureKind::Value,
980-
UpvarCapture::ByRef(borrow) => match borrow.kind {
979+
UpvarCapture::ByValue => CaptureKind::Value,
980+
UpvarCapture::ByRef(kind) => match kind {
981981
BorrowKind::ImmBorrow => CaptureKind::Ref(Mutability::Not),
982982
BorrowKind::UniqueImmBorrow | BorrowKind::MutBorrow => {
983983
CaptureKind::Ref(Mutability::Mut)

0 commit comments

Comments
 (0)