@@ -21,7 +21,7 @@ declare_clippy_lint! {
21
21
/// ```rust
22
22
/// # let foo: u32 = 5;
23
23
/// # let _ =
24
- /// foo <= i32::max_value() as u32
24
+ /// foo <= i32::MAX as u32
25
25
/// # ;
26
26
/// ```
27
27
///
@@ -179,7 +179,7 @@ impl ConversionType {
179
179
}
180
180
}
181
181
182
- /// Check for `expr <= (to_type::max_value() as from_type)`
182
+ /// Check for `expr <= (to_type::MAX as from_type)`
183
183
fn check_upper_bound < ' tcx > ( expr : & ' tcx Expr < ' tcx > ) -> Option < Conversion < ' tcx > > {
184
184
if_chain ! {
185
185
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<Conversion<'tcx>> {
194
194
}
195
195
}
196
196
197
- /// Check for `expr >= 0|(to_type::min_value() as from_type)`
197
+ /// Check for `expr >= 0|(to_type::MIN as from_type)`
198
198
fn check_lower_bound < ' tcx > ( expr : & ' tcx Expr < ' tcx > ) -> Option < Conversion < ' tcx > > {
199
199
fn check_function < ' a > ( candidate : & ' a Expr < ' a > , check : & ' a Expr < ' a > ) -> Option < Conversion < ' a > > {
200
200
( 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
222
222
}
223
223
}
224
224
225
- /// Check for `expr >= (to_type::min_value() as from_type)`
225
+ /// Check for `expr >= (to_type::MIN as from_type)`
226
226
fn check_lower_bound_min < ' a > ( candidate : & ' a Expr < ' _ > , check : & ' a Expr < ' _ > ) -> Option < Conversion < ' a > > {
227
227
if let Some ( ( from, to) ) = get_types_from_cast ( check, MIN_VALUE , SINTS ) {
228
228
Conversion :: try_new ( candidate, from, to)
0 commit comments