Skip to content

Commit

Permalink
Move description into lint macro
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Jun 4, 2022
1 parent 17595c6 commit 8185ecd
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions clippy_lints/src/needless_parens_on_range_literal.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
//! Checks for parantheses on literals in range statements
//!
//! For example, the lint would catch
//!
//! ```rust
//! for i in (0)..10 {
//! println!("{i}");
//! }
//! ```
//!
//! Use instead:
//!
//! ```rust
//! for i in 0..10 {
//! println!("{i}");
//! }
//! ```
//!
use clippy_utils::{
diagnostics::span_lint_and_then,
higher,
Expand All @@ -38,7 +19,22 @@ declare_clippy_lint! {
/// ### Why is this bad?
/// Having superflous parenthesis makes the code less legible as the impose an
/// overhead when reading.
///
/// ### Example
///
/// ```rust
/// for i in (0)..10 {
/// println!("{i}");
/// }
/// ```
///
/// Use instead:
///
/// ```rust
/// for i in 0..10 {
/// println!("{i}");
/// }
/// ```
#[clippy::version = "1.63.0"]
pub NEEDLESS_PARENS_ON_RANGE_LITERAL,
style,
Expand Down

0 comments on commit 8185ecd

Please sign in to comment.