mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Invert condition to unindent code
This commit is contained in:
parent
086f1c4b30
commit
700a3d5d75
1 changed files with 159 additions and 160 deletions
|
@ -874,7 +874,9 @@ impl ModCollector<'_, '_> {
|
||||||
|
|
||||||
for &item in items {
|
for &item in items {
|
||||||
let attrs = self.item_tree.attrs(item.into());
|
let attrs = self.item_tree.attrs(item.into());
|
||||||
if self.is_cfg_enabled(attrs) {
|
if !self.is_cfg_enabled(attrs) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let module =
|
let module =
|
||||||
ModuleId { krate: self.def_collector.def_map.krate, local_id: self.module_id };
|
ModuleId { krate: self.def_collector.def_map.krate, local_id: self.module_id };
|
||||||
let container = ContainerId::ModuleId(module);
|
let container = ContainerId::ModuleId(module);
|
||||||
|
@ -911,9 +913,7 @@ impl ModCollector<'_, '_> {
|
||||||
let container = ContainerId::ModuleId(module);
|
let container = ContainerId::ModuleId(module);
|
||||||
let impl_id = ImplLoc { container, id: ItemTreeId::new(self.file_id, imp) }
|
let impl_id = ImplLoc { container, id: ItemTreeId::new(self.file_id, imp) }
|
||||||
.intern(self.def_collector.db);
|
.intern(self.def_collector.db);
|
||||||
self.def_collector.def_map.modules[self.module_id]
|
self.def_collector.def_map.modules[self.module_id].scope.define_impl(impl_id)
|
||||||
.scope
|
|
||||||
.define_impl(impl_id)
|
|
||||||
}
|
}
|
||||||
ModItem::Function(id) => {
|
ModItem::Function(id) => {
|
||||||
let func = &self.item_tree[id];
|
let func = &self.item_tree[id];
|
||||||
|
@ -1054,7 +1054,6 @@ impl ModCollector<'_, '_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn collect_module(&mut self, module: &Mod, attrs: &Attrs) {
|
fn collect_module(&mut self, module: &Mod, attrs: &Attrs) {
|
||||||
let path_attr = attrs.by_key("path").string_value();
|
let path_attr = attrs.by_key("path").string_value();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue