RS.CLIPPY.PERMISSIONS_SET_READONLY_FALSE

Checks for calls to `std::fs::Permissions.set_readonly` with argument `false`

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: permissions_set_readonly_false. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for calls to std::fs::Permissions.set_readonly with argument false.

Why is this bad?

On Unix platforms this results in the file being world writable, equivalent to chmod a+w <file>.

Example

use std::fs::File;
let f = File::create("foo.txt").unwrap();
let metadata = f.metadata().unwrap();
let mut permissions = metadata.permissions();
permissions.set_readonly(false);