]> git.lizzy.rs Git - rust.git/blobdiff - clippy_utils/src/eager_or_lazy.rs
Rollup merge of #88230 - steffahn:a_an, r=oli-obk
[rust.git] / clippy_utils / src / eager_or_lazy.rs
index 81cd99c0558dce7f8f149eab452c72562d06d147..29e2559fc6d603d45a05b8d0e91b142095f23f57 100644 (file)
@@ -9,7 +9,8 @@
 //!  - or-fun-call
 //!  - option-if-let-else
 
-use crate::{is_ctor_or_promotable_const_function, is_type_diagnostic_item, match_type, paths};
+use crate::is_ctor_or_promotable_const_function;
+use crate::ty::is_type_diagnostic_item;
 use rustc_hir::def::{DefKind, Res};
 
 use rustc_hir::intravisit;
@@ -59,6 +60,7 @@ fn identify_some_pure_patterns(expr: &Expr<'_>) -> bool {
         | ExprKind::MethodCall(..)
         | ExprKind::Binary(..)
         | ExprKind::Unary(..)
+        | ExprKind::Let(..)
         | ExprKind::Cast(..)
         | ExprKind::Type(..)
         | ExprKind::DropTemps(..)
@@ -101,7 +103,7 @@ fn visit_expr(&mut self, expr: &'tcx Expr<'tcx>) {
                 ExprKind::Index(obj, _) => {
                     let ty = self.cx.typeck_results().expr_ty(obj);
                     is_type_diagnostic_item(self.cx, ty, sym::hashmap_type)
-                        || match_type(self.cx, ty, &paths::BTREEMAP)
+                        || is_type_diagnostic_item(self.cx, ty, sym::BTreeMap)
                 },
                 ExprKind::MethodCall(..) => true,
                 _ => false,