File tree Expand file tree Collapse file tree 1 file changed +16
-20
lines changed Expand file tree Collapse file tree 1 file changed +16
-20
lines changed Original file line number Diff line number Diff line change 1
- //! Checks for parantheses on literals in range statements
2
- //!
3
- //! For example, the lint would catch
4
- //!
5
- //! ```rust
6
- //! for i in (0)..10 {
7
- //! println!("{i}");
8
- //! }
9
- //! ```
10
- //!
11
- //! Use instead:
12
- //!
13
- //! ```rust
14
- //! for i in 0..10 {
15
- //! println!("{i}");
16
- //! }
17
- //! ```
18
- //!
19
-
20
1
use clippy_utils:: {
21
2
diagnostics:: span_lint_and_then,
22
3
higher,
@@ -38,7 +19,22 @@ declare_clippy_lint! {
38
19
/// ### Why is this bad?
39
20
/// Having superflous parenthesis makes the code less legible as the impose an
40
21
/// overhead when reading.
41
-
22
+ ///
23
+ /// ### Example
24
+ ///
25
+ /// ```rust
26
+ /// for i in (0)..10 {
27
+ /// println!("{i}");
28
+ /// }
29
+ /// ```
30
+ ///
31
+ /// Use instead:
32
+ ///
33
+ /// ```rust
34
+ /// for i in 0..10 {
35
+ /// println!("{i}");
36
+ /// }
37
+ /// ```
42
38
#[ clippy:: version = "1.63.0" ]
43
39
pub NEEDLESS_PARENS_ON_RANGE_LITERAL ,
44
40
style,
You can’t perform that action at this time.
0 commit comments