summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/to_digit_is_some.txt
blob: eee8375adf7aee3912818f6c74e3ce7058a24d0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
### What it does
Checks for `.to_digit(..).is_some()` on `char`s.

### Why is this bad?
This is a convoluted way of checking if a `char` is a digit. It's
more straight forward to use the dedicated `is_digit` method.

### Example
```
let is_digit = c.to_digit(radix).is_some();
```
can be written as:
```
let is_digit = c.is_digit(radix);
```