Skip to content

Commit ce7e4a7

Browse files
committed
clippy, simplify
1 parent bc2e6df commit ce7e4a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/methods/mut_mutex_lock.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, recv: &'tcx Expr<'tcx>, name_s
2121
let impls_index_mut = |ty, idx| index_mut_trait.is_some_and(|trait_id| implements_trait(cx, ty, trait_id, &[idx]));
2222
let mut r = recv;
2323
'outer: loop {
24-
if !(typeck.expr_adjustments(r))
24+
if (typeck.expr_adjustments(r))
2525
.iter()
2626
.map_while(|a| match a.kind {
2727
Adjust::Deref(x) => Some((a.target, x)),
2828
_ => None,
2929
})
3030
.try_fold(typeck.expr_ty(r), |ty, (target, deref)| match deref {
31-
None => (ty.ref_mutability() != Some(Mutability::Not)).then_some(target),
3231
Some(_) => impls_deref_mut(ty).then_some(target),
32+
None => (ty.ref_mutability() != Some(Mutability::Not)).then_some(target),
3333
})
34-
.is_some()
34+
.is_none()
3535
{
3636
return;
3737
}

0 commit comments

Comments
 (0)