From 0b2ba8be689225d6f243e484816cfc91f2b45bc4 Mon Sep 17 00:00:00 2001 From: lhvy Date: Fri, 1 Oct 2021 02:05:00 +1000 Subject: [PATCH] Fix builtin_crates return type change --- crates/ide/src/syntax_highlighting/highlight.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index ef6d51f7213..5113ab84d53 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs @@ -515,7 +515,7 @@ fn highlight_def( }); let is_from_other_crate = def_crate != krate; let is_from_builtin_crate = - def_crate.map_or(false, |it| famous_defs.builtin_crates().contains(&it)); + def_crate.map_or(false, |def_crate| famous_defs.builtin_crates().any(|it| def_crate == it)); let is_builtin_type = matches!(def, Definition::ModuleDef(hir::ModuleDef::BuiltinType(_))); let is_public = def.visibility(db) == Some(hir::Visibility::Public); @@ -564,7 +564,7 @@ fn highlight_method_call( let famous_defs = FamousDefs(&sema, krate); let def_crate = func.module(sema.db).krate(); let is_from_other_crate = Some(def_crate) != krate; - let is_from_builtin_crate = famous_defs.builtin_crates().contains(&def_crate); + let is_from_builtin_crate = famous_defs.builtin_crates().any(|it| def_crate == it); let is_public = func.visibility(sema.db) == hir::Visibility::Public; if is_from_other_crate {