@@ -147,7 +147,7 @@ impl<'tcx> LateLintPass<'tcx> for Ranges {
147
147
if let ExprKind :: MethodCall ( ref iter_path, _, ref iter_args , _) = * iter;
148
148
if iter_path. ident. name == sym!( iter) ;
149
149
// range expression in `.zip()` call: `0..x.len()`
150
- if let Some ( higher:: Range { start: Some ( start) , end: Some ( end) , .. } ) = higher:: range( cx , zip_arg) ;
150
+ if let Some ( higher:: Range { start: Some ( start) , end: Some ( end) , .. } ) = higher:: range( zip_arg) ;
151
151
if is_integer_const( cx, start, 0 ) ;
152
152
// `.len()` call
153
153
if let ExprKind :: MethodCall ( ref len_path, _, ref len_args, _) = end. kind;
@@ -180,7 +180,7 @@ fn check_exclusive_range_plus_one(cx: &LateContext<'_>, expr: &Expr<'_>) {
180
180
start,
181
181
end: Some ( end) ,
182
182
limits: RangeLimits :: HalfOpen
183
- } ) = higher:: range( cx , expr) ;
183
+ } ) = higher:: range( expr) ;
184
184
if let Some ( y) = y_plus_one( cx, end) ;
185
185
then {
186
186
let span = if expr. span. from_expansion( ) {
@@ -225,7 +225,7 @@ fn check_exclusive_range_plus_one(cx: &LateContext<'_>, expr: &Expr<'_>) {
225
225
// inclusive range minus one: `x..=(y-1)`
226
226
fn check_inclusive_range_minus_one ( cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) {
227
227
if_chain ! {
228
- if let Some ( higher:: Range { start, end: Some ( end) , limits: RangeLimits :: Closed } ) = higher:: range( cx , expr) ;
228
+ if let Some ( higher:: Range { start, end: Some ( end) , limits: RangeLimits :: Closed } ) = higher:: range( expr) ;
229
229
if let Some ( y) = y_minus_one( cx, end) ;
230
230
then {
231
231
span_lint_and_then(
@@ -279,7 +279,7 @@ fn check_reversed_empty_range(cx: &LateContext<'_>, expr: &Expr<'_>) {
279
279
}
280
280
281
281
if_chain ! {
282
- if let Some ( higher:: Range { start: Some ( start) , end: Some ( end) , limits } ) = higher:: range( cx , expr) ;
282
+ if let Some ( higher:: Range { start: Some ( start) , end: Some ( end) , limits } ) = higher:: range( expr) ;
283
283
let ty = cx. typeck_results( ) . expr_ty( start) ;
284
284
if let ty:: Int ( _) | ty:: Uint ( _) = ty. kind;
285
285
if let Some ( ( start_idx, _) ) = constant( cx, cx. typeck_results( ) , start) ;
0 commit comments