summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/option_as_ref_deref.txt
blob: ad7411d3d4bd934b33f39e20f9fd71ead51fed14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
### What it does
Checks for usage of `_.as_ref().map(Deref::deref)` or it's aliases (such as String::as_str).

### Why is this bad?
Readability, this can be written more concisely as
`_.as_deref()`.

### Example
```
opt.as_ref().map(String::as_str)
```
Can be written as
```
opt.as_deref()
```