summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/non_octal_unix_permissions.txt
blob: 4a468e94db1641f7a38aa37ee340e517c384268c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
### What it does
Checks for non-octal values used to set Unix file permissions.

### Why is this bad?
They will be converted into octal, creating potentially
unintended file permissions.

### Example
```
use std::fs::OpenOptions;
use std::os::unix::fs::OpenOptionsExt;

let mut options = OpenOptions::new();
options.mode(644);
```
Use instead:
```
use std::fs::OpenOptions;
use std::os::unix::fs::OpenOptionsExt;

let mut options = OpenOptions::new();
options.mode(0o644);
```