summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/ref_option_ref.txt
blob: 951c7bd7f7ec6c61810e334d03c128cf74b1771a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
### What it does
Checks for usage of `&Option<&T>`.

### Why is this bad?
Since `&` is Copy, it's useless to have a
reference on `Option<&T>`.

### Known problems
It may be irrelevant to use this lint on
public API code as it will make a breaking change to apply it.

### Example
```
let x: &Option<&u32> = &Some(&0u32);
```
Use instead:
```
let x: Option<&u32> = Some(&0u32);
```