Replace simple is_named with matches macro

This commit is contained in:
Paul Daniel Faria 2020-06-26 22:51:13 -04:00
parent b700443e78
commit 1f5d30ff16

View file

@ -18,15 +18,6 @@ pub(crate) enum ImportType {
Named, Named,
} }
impl ImportType {
fn is_named(&self) -> bool {
match self {
ImportType::Glob => false,
ImportType::Named => true,
}
}
}
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub struct PerNsGlobImports { pub struct PerNsGlobImports {
types: FxHashSet<(LocalModuleId, Name)>, types: FxHashSet<(LocalModuleId, Name)>,
@ -200,7 +191,7 @@ impl ItemScope {
} }
(Some(_), Some(_)) (Some(_), Some(_))
if $glob_imports.$field.contains(&$lookup) if $glob_imports.$field.contains(&$lookup)
&& $def_import_type.is_named() => && matches!($def_import_type, ImportType::Named) =>
{ {
mark::hit!(import_shadowed); mark::hit!(import_shadowed);
$glob_imports.$field.remove(&$lookup); $glob_imports.$field.remove(&$lookup);