Refactor out PrimitiveTypeTable

This commit is contained in:
Cameron Steffen
2021-02-02 12:16:35 -06:00
parent b81f5811f9
commit fba747a06e
6 changed files with 67 additions and 62 deletions

View File

@@ -1210,8 +1210,8 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
// Add primitive types to the mix
if filter_fn(Res::PrimTy(PrimTy::Bool)) {
names.extend(
self.r.primitive_type_table.primitive_types.iter().map(|(name, prim_ty)| {
TypoSuggestion::from_res(*name, Res::PrimTy(*prim_ty))
PrimTy::ALL.iter().map(|prim_ty| {
TypoSuggestion::from_res(prim_ty.name(), Res::PrimTy(*prim_ty))
}),
)
}