Skip to content

Commit 7ab4769

Browse files
committed
replace break from block with if
1 parent 2723f6c commit 7ab4769

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/lib.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -543,20 +543,18 @@ where
543543
Err(aborted) => Err(Error::from(aborted)),
544544
};
545545

546-
'do_not_mutate: {
546+
{
547547
// Only sync code in this block
548548
let mut inner = self.inner.lock();
549549

550-
if matches!(res, Err(Error::Aborted(_))) {
550+
if !matches!(res, Err(Error::Aborted(_))) {
551551
// If we aborted, we have to leave inner as is
552552
// Otherwise big races come up as the next inflight computation might already be underway at this point
553-
break 'do_not_mutate;
554-
}
555-
556-
if let Ok(value) = &res {
557-
*inner = CachedInner::CachedValue(value.clone());
558-
} else {
559-
*inner = CachedInner::new();
553+
if let Ok(value) = &res {
554+
*inner = CachedInner::CachedValue(value.clone());
555+
} else {
556+
*inner = CachedInner::new();
557+
}
560558
}
561559
}
562560

0 commit comments

Comments
 (0)