diff --git a/clippy_lints/src/checked_conversions.rs b/clippy_lints/src/checked_conversions.rs index 88baaea9e562..d9776dd50a83 100644 --- a/clippy_lints/src/checked_conversions.rs +++ b/clippy_lints/src/checked_conversions.rs @@ -21,7 +21,7 @@ declare_clippy_lint! { /// ```rust /// # let foo: u32 = 5; /// # let _ = - /// foo <= i32::max_value() as u32 + /// foo <= i32::MAX as u32 /// # ; /// ``` /// @@ -179,7 +179,7 @@ impl ConversionType { } } -/// Check for `expr <= (to_type::max_value() as from_type)` +/// Check for `expr <= (to_type::MAX as from_type)` fn check_upper_bound<'tcx>(expr: &'tcx Expr<'tcx>) -> Option> { if_chain! { if let ExprKind::Binary(ref op, ref left, ref right) = &expr.kind; @@ -194,7 +194,7 @@ fn check_upper_bound<'tcx>(expr: &'tcx Expr<'tcx>) -> Option> { } } -/// Check for `expr >= 0|(to_type::min_value() as from_type)` +/// Check for `expr >= 0|(to_type::MIN as from_type)` fn check_lower_bound<'tcx>(expr: &'tcx Expr<'tcx>) -> Option> { fn check_function<'a>(candidate: &'a Expr<'a>, check: &'a Expr<'a>) -> Option> { (check_lower_bound_zero(candidate, check)).or_else(|| (check_lower_bound_min(candidate, check))) @@ -222,7 +222,7 @@ fn check_lower_bound_zero<'a>(candidate: &'a Expr<'_>, check: &'a Expr<'_>) -> O } } -/// Check for `expr >= (to_type::min_value() as from_type)` +/// Check for `expr >= (to_type::MIN as from_type)` fn check_lower_bound_min<'a>(candidate: &'a Expr<'_>, check: &'a Expr<'_>) -> Option> { if let Some((from, to)) = get_types_from_cast(check, MIN_VALUE, SINTS) { Conversion::try_new(candidate, from, to)