From 7a091b3f650c8e98ba85d232d4a4b4e6070b0531 Mon Sep 17 00:00:00 2001 From: vohoanglong0107 Date: Thu, 4 Apr 2024 03:04:50 +0000 Subject: [PATCH] docs: explain more clearly why it was bad --- clippy_lints/src/methods/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 667f73039619..3ad036edb2ee 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -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);