Fix builtin_crates return type change

This commit is contained in:
lhvy 2021-10-01 02:05:00 +10:00
parent 64cbdf6d55
commit 0b2ba8be68
No known key found for this signature in database
GPG Key ID: E6CAEAA74B3C53AC

View File

@ -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 {