Skip to content

Commit 02d77dd

Browse files
committed
rustc_resolve: flatten nested ifs
1 parent 8bf43d9 commit 02d77dd

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

compiler/rustc_resolve/src/diagnostics.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,12 +1309,16 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
13091309
let is_extern_crate_that_also_appears_in_prelude =
13101310
name_binding.is_extern_crate() && lookup_ident.span.at_least_rust_2018();
13111311

1312-
if !is_extern_crate_that_also_appears_in_prelude || alias_import {
1312+
if (!is_extern_crate_that_also_appears_in_prelude || alias_import)
13131313
// add the module to the lookup
1314-
if seen_modules.insert(module.def_id()) {
1315-
if via_import { &mut worklist_via_import } else { &mut worklist }
1316-
.push((module, path_segments, child_accessible, child_doc_visible));
1317-
}
1314+
&& seen_modules.insert(module.def_id())
1315+
{
1316+
if via_import { &mut worklist_via_import } else { &mut worklist }.push((
1317+
module,
1318+
path_segments,
1319+
child_accessible,
1320+
child_doc_visible,
1321+
));
13181322
}
13191323
}
13201324
})

0 commit comments

Comments
 (0)