]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/array_indexing.rs
Move `unsugar_range` to `utils::higher`
[rust.git] / clippy_lints / src / array_indexing.rs
index f3b7297b2969326938e7ecf64e00b20f26fec603..2c84c7cc13213fcf3bb00f76a3e8eb7386c4c5ef 100644 (file)
@@ -6,7 +6,7 @@
 use rustc_const_math::ConstInt;
 use rustc::hir::*;
 use syntax::ast::RangeLimits;
-use utils;
+use utils::{self, higher};
 
 /// **What it does:** Check for out of bounds array indexing with a constant index.
 ///
@@ -77,7 +77,7 @@ fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
                 }
 
                 // Index is a constant range
-                if let Some(range) = utils::unsugar_range(index) {
+                if let Some(range) = higher::range(index) {
                     let start = range.start
                         .map(|start| eval_const_expr_partial(cx.tcx, start, ExprTypeChecked, None))
                         .map(|v| v.ok());
@@ -94,7 +94,7 @@ fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
                 }
             }
 
-            if let Some(range) = utils::unsugar_range(index) {
+            if let Some(range) = higher::range(index) {
                 // Full ranges are always valid
                 if range.start.is_none() && range.end.is_none() {
                     return;