Skip to content

Commit e12ff63

Browse files
committed
permissions_set_readonly_false: Check HIR tree first.
1 parent 15eac5a commit e12ff63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/permissions_set_readonly_false.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ declare_lint_pass!(PermissionsSetReadonlyFalse => [PERMISSIONS_SET_READONLY_FALS
3131
impl<'tcx> LateLintPass<'tcx> for PermissionsSetReadonlyFalse {
3232
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
3333
if let ExprKind::MethodCall(path, receiver, [arg], _) = &expr.kind
34-
&& is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(receiver), sym::FsPermissions)
35-
&& path.ident.name == sym!(set_readonly)
3634
&& let ExprKind::Lit(lit) = &arg.kind
3735
&& LitKind::Bool(false) == lit.node
36+
&& path.ident.name.as_str() == "set_readonly"
37+
&& is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(receiver), sym::FsPermissions)
3838
{
3939
span_lint_and_then(
4040
cx,

0 commit comments

Comments
 (0)