Skip to content

Commit 39eaf78

Browse files
committed
Auto merge of rust-lang#13253 - Veykril:simplify, r=Veykril
Simplify
2 parents 11bf2e7 + 0d9f971 commit 39eaf78

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

crates/hir-def/src/item_scope.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::{
1818
ConstId, HasModule, ImplId, LocalModuleId, MacroId, ModuleDefId, ModuleId, TraitId,
1919
};
2020

21-
#[derive(Copy, Clone)]
21+
#[derive(Copy, Clone, Debug)]
2222
pub(crate) enum ImportType {
2323
Glob,
2424
Named,
@@ -302,13 +302,13 @@ impl ItemScope {
302302
$changed = true;
303303
}
304304
Entry::Occupied(mut entry)
305-
if $glob_imports.$field.contains(&$lookup)
306-
&& matches!($def_import_type, ImportType::Named) =>
305+
if matches!($def_import_type, ImportType::Named) =>
307306
{
308-
cov_mark::hit!(import_shadowed);
309-
$glob_imports.$field.remove(&$lookup);
310-
entry.insert(fld);
311-
$changed = true;
307+
if $glob_imports.$field.remove(&$lookup) {
308+
cov_mark::hit!(import_shadowed);
309+
entry.insert(fld);
310+
$changed = true;
311+
}
312312
}
313313
_ => {}
314314
}

0 commit comments

Comments
 (0)