mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Replace simple is_named with matches macro
This commit is contained in:
parent
b700443e78
commit
1f5d30ff16
1 changed files with 1 additions and 10 deletions
|
@ -18,15 +18,6 @@ pub(crate) enum ImportType {
|
|||
Named,
|
||||
}
|
||||
|
||||
impl ImportType {
|
||||
fn is_named(&self) -> bool {
|
||||
match self {
|
||||
ImportType::Glob => false,
|
||||
ImportType::Named => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct PerNsGlobImports {
|
||||
types: FxHashSet<(LocalModuleId, Name)>,
|
||||
|
@ -200,7 +191,7 @@ impl ItemScope {
|
|||
}
|
||||
(Some(_), Some(_))
|
||||
if $glob_imports.$field.contains(&$lookup)
|
||||
&& $def_import_type.is_named() =>
|
||||
&& matches!($def_import_type, ImportType::Named) =>
|
||||
{
|
||||
mark::hit!(import_shadowed);
|
||||
$glob_imports.$field.remove(&$lookup);
|
||||
|
|
Loading…
Reference in a new issue