Skip to content

Commit 41f89be

Browse files
committed
if let
1 parent ec8cc02 commit 41f89be

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/stacked_borrows.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,9 @@ impl<'tcx> Stack {
151151
/// Returns the index of the item we matched, `None` if it was the frozen one.
152152
/// `kind` indicates which kind of reference is being dereferenced.
153153
fn deref(&self, bor: Borrow, kind: RefKind) -> Result<Option<usize>, String> {
154-
// Exclude unique ref and frozen tag.
155-
match (kind, bor) {
156-
(RefKind::Unique, Borrow::Shr(Some(_))) =>
157-
return Err(format!("Encountered mutable reference with frozen tag")),
158-
_ => {}
154+
// Exclude unique ref with frozen tag.
155+
if let (RefKind::Unique, Borrow::Shr(Some(_))) = (kind, bor) {
156+
return Err(format!("Encountered mutable reference with frozen tag"));
159157
}
160158
// Checks related to freezing
161159
match bor {

0 commit comments

Comments
 (0)