Skip to content

Commit 7a091b3

Browse files
docs: explain more clearly why it was bad
1 parent 4710ece commit 7a091b3

File tree

1 file changed

+6
-2
lines changed
  • clippy_lints/src/methods

1 file changed

+6
-2
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3973,11 +3973,15 @@ declare_clippy_lint! {
39733973

39743974
declare_clippy_lint! {
39753975
/// ### What it does
3976-
/// Checks for unnecessary calls to `min()` or `max()`
3976+
/// Checks for unnecessary calls to `min()` or `max()` in the following cases
3977+
/// - Either both side is constant
3978+
/// - One side is clearly larger than the other, like i32::MIN and an i32 variable
39773979
///
39783980
/// ### Why is this bad?
39793981
///
3980-
/// In these cases it is not necessary to call `min()`
3982+
/// In the aformentioned cases it is not necessary to call `min()` or `max()`
3983+
/// to compare values, it may even cause confusion.
3984+
///
39813985
/// ### Example
39823986
/// ```no_run
39833987
/// let _ = 0.min(7_u32);

0 commit comments

Comments
 (0)