mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
refactor: fix style
This commit is contained in:
parent
30e6e85508
commit
e1d3c1e8f1
@ -34,15 +34,16 @@ impl<'tcx> LateLintPass<'tcx> for PermissionsSetReadonlyFalse {
|
||||
&& match_type(cx, cx.typeck_results().expr_ty(receiver), &paths::PERMISSIONS)
|
||||
&& path.ident.name == sym!(set_readonly)
|
||||
&& let ExprKind::Lit(lit) = &arg.kind
|
||||
&& LitKind::Bool(false) == lit.node {
|
||||
span_lint_and_note(
|
||||
cx,
|
||||
PERMISSIONS_SET_READONLY_FALSE,
|
||||
expr.span,
|
||||
"call to `set_readonly` with argument `false`",
|
||||
None,
|
||||
"on Unix platforms this results in the file being world writable",
|
||||
);
|
||||
&& LitKind::Bool(false) == lit.node
|
||||
{
|
||||
span_lint_and_note(
|
||||
cx,
|
||||
PERMISSIONS_SET_READONLY_FALSE,
|
||||
expr.span,
|
||||
"call to `set_readonly` with argument `false`",
|
||||
None,
|
||||
"on Unix platforms this results in the file being world writable",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user