Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2e6903c

Browse files
committed
Move description into lint macro
1 parent 90c8463 commit 2e6903c

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

clippy_lints/src/needless_parens_on_range_literal.rs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
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-
201
use clippy_utils::{
212
diagnostics::span_lint_and_then,
223
higher,
@@ -38,7 +19,22 @@ declare_clippy_lint! {
3819
/// ### Why is this bad?
3920
/// Having superflous parenthesis makes the code less legible as the impose an
4021
/// 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+
/// ```
4238
#[clippy::version = "1.63.0"]
4339
pub NEEDLESS_PARENS_ON_RANGE_LITERAL,
4440
style,

0 commit comments

Comments
 (0)