Skip to content

Commit e55065e

Browse files
committed
Re-use visit_mod in visit_cfg_if
1 parent d768862 commit e55065e

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/modules.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,7 @@ impl<'ast, 'sess> ModResolver<'ast, 'sess> {
155155
fn visit_cfg_if(&mut self, item: &ast::Item) -> Result<(), ModuleResolutionError> {
156156
let mut visitor = visitor::CfgIfVisitor::new(self.parse_sess);
157157
visitor.visit_item(item);
158-
for item in visitor.items {
159-
if let ast::ItemKind::Mod(_, ref sub_mod_kind) = item.kind {
160-
let items = match sub_mod_kind {
161-
ast::ModKind::Loaded(items, ..) => Cow::Borrowed(items),
162-
_ => Cow::Owned(ThinVec::new()),
163-
};
164-
self.visit_sub_mod(&item, Module::new(item.span, items, &[]), false)?;
165-
}
166-
}
158+
self.visit_mod(&visitor.items, false)?;
167159
Ok(())
168160
}
169161

0 commit comments

Comments
 (0)