summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/result_map_or_into_option.txt
blob: 899d98c307c8f463605fba0b1110a65d86a6413f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
### What it does
Checks for usage of `_.map_or(None, Some)`.

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

### Example
```
assert_eq!(Some(1), r.map_or(None, Some));
```

Use instead:
```
assert_eq!(Some(1), r.ok());
```