Skip to content

Commit 8c031ca

Browse files
longfangsongJoshua Nelson
andauthored
Update src/librustdoc/doctree.rs
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
1 parent 29ebc1e commit 8c031ca

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/librustdoc/doctree.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ impl Module<'hir> {
7979
}
8080

8181
pub(crate) fn push_mod(&mut self, new_item: Module<'hir>) {
82-
for item_iter in self.mods.iter_mut() {
83-
if item_iter.name == new_item.name {
82+
if let Some(shadowed_mod) = self.mods.iter_mut().find(|mod_| mod_.name == new_item.name) {
8483
if item_iter.from_glob {
8584
debug!("push_mod: {:?} shadowed by {:?}", item_iter.name, new_item.name);
8685
*item_iter = new_item;

0 commit comments

Comments
 (0)