mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +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,
|
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);
|
||||||
|
|
Loading…
Reference in a new issue