Skip to content

Commit

Permalink
docs: explain more clearly why it was bad
Browse files Browse the repository at this point in the history
  • Loading branch information
vohoanglong0107 committed Apr 4, 2024
1 parent 4710ece commit 7a091b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3973,11 +3973,15 @@ declare_clippy_lint! {

declare_clippy_lint! {
/// ### What it does
/// Checks for unnecessary calls to `min()` or `max()`
/// Checks for unnecessary calls to `min()` or `max()` in the following cases
/// - Either both side is constant
/// - One side is clearly larger than the other, like i32::MIN and an i32 variable
///
/// ### Why is this bad?
///
/// In these cases it is not necessary to call `min()`
/// In the aformentioned cases it is not necessary to call `min()` or `max()`
/// to compare values, it may even cause confusion.
///
/// ### Example
/// ```no_run
/// let _ = 0.min(7_u32);
Expand Down

0 comments on commit 7a091b3

Please sign in to comment.