File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,22 @@ use rustc::{declare_lint_pass, declare_tool_lint};
77use rustc_errors:: Applicability ;
88
99declare_clippy_lint ! {
10- /// **What it does:** Checks for `.to_digit().is_some()` on `char`s.
10+ /// **What it does:** Checks for `.to_digit(.. ).is_some()` on `char`s.
1111 ///
1212 /// **Why is this bad?** This is a convoluted way of checking if a `char` is a digit. It's
13- /// more straight forward use the dedicated `is_digit` method.
13+ /// more straight forward to use the dedicated `is_digit` method.
1414 ///
1515 /// **Example:**
1616 /// ```rust
17- /// # let x: char = 'x'
18- /// let is_digit = x.to_digit().is_some();
17+ /// # let c = 'c';
18+ /// # let radix = 10;
19+ /// let is_digit = c.to_digit(10).is_some();
1920 /// ```
2021 /// can be written as:
2122 /// ```
22- /// # let x: char = 'x'
23- /// let is_digit = x.is_digit();
23+ /// # let c = 'c';
24+ /// # let radix = 10;
25+ /// let is_digit = c.is_digit(radix);
2426 /// ```
2527 pub TO_DIGIT_IS_SOME ,
2628 style,
You can’t perform that action at this time.
0 commit comments