Invert condition to unindent code

This commit is contained in:
Jonas Schievink 2020-09-18 12:32:07 +02:00
parent 086f1c4b30
commit 700a3d5d75

View file

@ -874,7 +874,9 @@ impl ModCollector<'_, '_> {
for &item in items {
let attrs = self.item_tree.attrs(item.into());
if self.is_cfg_enabled(attrs) {
if !self.is_cfg_enabled(attrs) {
continue;
}
let module =
ModuleId { krate: self.def_collector.def_map.krate, local_id: self.module_id };
let container = ContainerId::ModuleId(module);
@ -911,9 +913,7 @@ impl ModCollector<'_, '_> {
let container = ContainerId::ModuleId(module);
let impl_id = ImplLoc { container, id: ItemTreeId::new(self.file_id, imp) }
.intern(self.def_collector.db);
self.def_collector.def_map.modules[self.module_id]
.scope
.define_impl(impl_id)
self.def_collector.def_map.modules[self.module_id].scope.define_impl(impl_id)
}
ModItem::Function(id) => {
let func = &self.item_tree[id];
@ -1054,7 +1054,6 @@ impl ModCollector<'_, '_> {
}
}
}
}
fn collect_module(&mut self, module: &Mod, attrs: &Attrs) {
let path_attr = attrs.by_key("path").string_value();