Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/closure.rs')
-rw-r--r--crates/hir-ty/src/infer/closure.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/hir-ty/src/infer/closure.rs b/crates/hir-ty/src/infer/closure.rs
index 12039173dd..572df8f713 100644
--- a/crates/hir-ty/src/infer/closure.rs
+++ b/crates/hir-ty/src/infer/closure.rs
@@ -142,13 +142,10 @@ impl HirPlace {
mut current_capture: CaptureKind,
len: usize,
) -> CaptureKind {
- match current_capture {
- CaptureKind::ByRef(BorrowKind::Mut { .. }) => {
- if self.projections[len..].iter().any(|it| *it == ProjectionElem::Deref) {
- current_capture = CaptureKind::ByRef(BorrowKind::Unique);
- }
+ if let CaptureKind::ByRef(BorrowKind::Mut { .. }) = current_capture {
+ if self.projections[len..].iter().any(|it| *it == ProjectionElem::Deref) {
+ current_capture = CaptureKind::ByRef(BorrowKind::Unique);
}
- _ => (),
}
current_capture
}