Skip to content

Commit 1f5d30f

Browse files
committed
Replace simple is_named with matches macro
1 parent b700443 commit 1f5d30f

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

crates/ra_hir_def/src/item_scope.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ pub(crate) enum ImportType {
1818
Named,
1919
}
2020

21-
impl ImportType {
22-
fn is_named(&self) -> bool {
23-
match self {
24-
ImportType::Glob => false,
25-
ImportType::Named => true,
26-
}
27-
}
28-
}
29-
3021
#[derive(Debug, Default)]
3122
pub struct PerNsGlobImports {
3223
types: FxHashSet<(LocalModuleId, Name)>,
@@ -200,7 +191,7 @@ impl ItemScope {
200191
}
201192
(Some(_), Some(_))
202193
if $glob_imports.$field.contains(&$lookup)
203-
&& $def_import_type.is_named() =>
194+
&& matches!($def_import_type, ImportType::Named) =>
204195
{
205196
mark::hit!(import_shadowed);
206197
$glob_imports.$field.remove(&$lookup);

0 commit comments

Comments
 (0)