diff options
| author | bors <bors@rust-lang.org> | 2022-01-13 18:51:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-13 18:51:07 +0000 |
| commit | 22e491ac7ed454d34669151a8b6464cb643c9b41 (patch) | |
| tree | 8e30fdbc16b29cd272052aad7f885453ff789841 /src/tools/clippy/clippy_utils | |
| parent | 256721ee519f6ff15dc5c1cfaf3ebf9af75efa4a (diff) | |
| parent | c84cea9c25e8db73b1b580ab9c7f72985a05da4d (diff) | |
| download | rust-22e491ac7ed454d34669151a8b6464cb643c9b41.tar.gz rust-22e491ac7ed454d34669151a8b6464cb643c9b41.zip | |
Auto merge of #89861 - nbdd0121:closure, r=wesleywiser
Closure capture cleanup & refactor Follow up of #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`
Diffstat (limited to 'src/tools/clippy/clippy_utils')
| -rw-r--r-- | src/tools/clippy/clippy_utils/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs index 91ebc7ea89c..90f5baffd22 100644 --- a/src/tools/clippy/clippy_utils/src/lib.rs +++ b/src/tools/clippy/clippy_utils/src/lib.rs @@ -976,8 +976,8 @@ pub fn can_move_expr_to_closure(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> }; if !self.locals.contains(&local_id) { let capture = match capture.info.capture_kind { - UpvarCapture::ByValue(_) => CaptureKind::Value, - UpvarCapture::ByRef(borrow) => match borrow.kind { + UpvarCapture::ByValue => CaptureKind::Value, + UpvarCapture::ByRef(kind) => match kind { BorrowKind::ImmBorrow => CaptureKind::Ref(Mutability::Not), BorrowKind::UniqueImmBorrow | BorrowKind::MutBorrow => { CaptureKind::Ref(Mutability::Mut) |
