manual-clamp Prefer clamp over nested bound comparisons Nested comparisons that select the lower bound, upper bound, or original value manually clamp a number. Instead, you SHOULD call .clamp() on the value. .clamp() rejects inverted bounds and NaN bounds. - Category: style - Level: warning - Fix: suggestion - Scope: module Reported function bounded(value: int32, minimum: int32, maximum: int32): int32 { return value < minimum ? minimum : value > maximum ? maximum : value; } Accepted function bounded(value: int32, minimum: int32, maximum: int32): int32 { return value.clamp(minimum, maximum); } Prior art - Clippy ยท manualclamp language/linter/src/rules/style/manualclamp.rs:8